Skip to:
Content

bbPress.org


Ignore:
Timestamp:
08/28/2017 02:09:54 AM (4 years ago)
Author:
johnjamesjacoby
Message:

Core: Add source parameter to API registrations.

This change makes it easier to target bbPress-specific post types & statuses, and taxonomies. source may not be the final key, but thankfully all of these APIs accept additional keys, and if support is added to core eventually, we can easily migrate over to it without problems.

Trunk, for 2.6. See: https://core.trac.wordpress.org/ticket/41739

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/core/template-functions.php

    r6641 r6672  
    716716
    717717    // Do topics on forums root
    718     } elseif ( is_post_type_archive( array( bbp_get_forum_post_type(), bbp_get_topic_post_type() ) ) && ( 'topics' === bbp_show_on_root() ) ) {
     718    } elseif ( is_post_type_archive( get_post_types( array( 'source' => 'bbpress', 'has_archive' ) ) ) && ( 'topics' === bbp_show_on_root() ) ) {
    719719        $posts_query->bbp_show_topics_on_root = true;
    720720    }
Note: See TracChangeset for help on using the changeset viewer.