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/search/template.php

    r6629 r6672  
    2626
    2727    $default_search_terms = bbp_get_search_terms();
    28     $default_post_type    = array( bbp_get_forum_post_type(), bbp_get_topic_post_type(), bbp_get_reply_post_type() );
     28    $default_post_types   = get_post_types( array( 'source' => 'bbpress' ) );
    2929
    3030    // Default query args
    3131    $default = array(
    32         'post_type'           => $default_post_type,         // Forums, topics, and replies
     32        'post_type'           => $default_post_types,        // Forums, topics, and replies
    3333        'posts_per_page'      => bbp_get_replies_per_page(), // This many
    3434        'paged'               => bbp_get_paged(),            // On this page
Note: See TracChangeset for help on using the changeset viewer.