[ Index ]

PHP Cross Reference of BBPress

title

Body

[close]

/src/includes/core/ -> filters.php (source)

   1  <?php
   2  
   3  /**
   4   * bbPress Filters
   5   *
   6   * This file contains the filters that are used through-out bbPress. They are
   7   * consolidated here to make searching for them easier, and to help developers
   8   * understand at a glance the order in which things occur.
   9   *
  10   * There are a few common places that additional filters can currently be found
  11   *
  12   *  - bbPress: In {@link bbPress::setup_actions()} in bbpress.php
  13   *  - Admin: More in {@link BBP_Admin::setup_actions()} in admin.php
  14   *
  15   * @package bbPress
  16   * @subpackage Core
  17   *
  18   * @see /core/actions.php
  19   */
  20  
  21  // Exit if accessed directly
  22  defined( 'ABSPATH' ) || exit;
  23  
  24  /**
  25   * Attach bbPress to WordPress
  26   *
  27   * bbPress uses its own internal actions to help aid in third-party plugin
  28   * development, and to limit the amount of potential future code changes when
  29   * updates to WordPress core occur.
  30   *
  31   * These actions exist to create the concept of 'plugin dependencies'. They
  32   * provide a safe way for plugins to execute code *only* when bbPress is
  33   * installed and activated, without needing to do complicated guesswork.
  34   *
  35   * For more information on how this works, see the 'Plugin Dependency' section
  36   * near the bottom of this file.
  37   *
  38   *           v--WordPress Actions       v--bbPress Sub-actions
  39   */
  40  add_filter( 'request',                 'bbp_request',            10    );
  41  add_filter( 'template_include',        'bbp_template_include',   10    );
  42  add_filter( 'wp_mail',                 'bbp_mail',               10, 3 );
  43  add_filter( 'wp_title',                'bbp_title',              10, 3 );
  44  add_filter( 'body_class',              'bbp_body_class',         10, 2 );
  45  add_filter( 'map_meta_cap',            'bbp_map_meta_caps',      10, 4 );
  46  add_filter( 'allowed_themes',          'bbp_allowed_themes',     10    );
  47  add_filter( 'redirect_canonical',      'bbp_redirect_canonical', 10    );
  48  add_filter( 'login_redirect',          'bbp_redirect_login',     2,  3 );
  49  add_filter( 'logout_url',              'bbp_logout_url',         2,  2 );
  50  add_filter( 'plugin_locale',           'bbp_plugin_locale',      10, 2 );
  51  
  52  // Fix post author id for anonymous posts (set it back to 0) when the post status is changed
  53  add_filter( 'wp_insert_post_data', 'bbp_fix_post_author', 30, 2 );
  54  
  55  // Force comments_status on bbPress post types
  56  add_filter( 'comments_open', 'bbp_force_comment_status' );
  57  
  58  // Remove forums roles from list of all roles
  59  add_filter( 'editable_roles', 'bbp_filter_blog_editable_roles' );
  60  
  61  // Reply title fallback
  62  add_filter( 'the_title', 'bbp_get_reply_title_fallback', 2, 2 );
  63  
  64  // Avoid queries & 404s
  65  add_filter( 'pre_handle_404',  'bbp_pre_handle_404',  10, 2 );
  66  add_action( 'posts_pre_query', 'bbp_posts_pre_query', 10, 2 );
  67  
  68  // User Creation
  69  add_filter( 'signup_user_meta', 'bbp_user_add_role_to_signup_meta', 10 );
  70  
  71  /**
  72   * Emails
  73   *
  74   * bbPress sends emails for a few different reasons, largely related to user
  75   * notifications or account changes. Because the `wp_mail` filter can be a
  76   * crowded space, the `bbp_mail` subfilter should be used in conjunction with
  77   * bbp_get_email_header() to narrow the results to only bbPress emails.
  78   */
  79  add_filter( 'bbp_mail', 'bbp_chunk_emails' );
  80  
  81  /**
  82   * Feeds
  83   *
  84   * bbPress comes with a number of custom RSS2 feeds that get handled outside
  85   * the normal scope of feeds that WordPress would normally serve. To do this,
  86   * we filter every page request, listen for a feed request, and trap it.
  87   */
  88  add_filter( 'bbp_request', 'bbp_request_feed_trap' );
  89  
  90  /**
  91   * Template Compatibility
  92   *
  93   * If you want to completely bypass this and manage your own custom bbPress
  94   * template hierarchy, start here by removing this filter, then look at how
  95   * bbp_template_include() works and do something similar. :)
  96   */
  97  add_filter( 'bbp_template_include', 'bbp_template_include_theme_supports', 2, 1 );
  98  add_filter( 'bbp_template_include', 'bbp_template_include_theme_compat',   4, 2 );
  99  
 100  // Filter bbPress template locations
 101  add_filter( 'bbp_get_template_stack', 'bbp_add_template_stack_locations' );
 102  
 103  // Links
 104  add_filter( 'paginate_links',          'bbp_add_view_all' );
 105  add_filter( 'bbp_get_topic_permalink', 'bbp_add_view_all' );
 106  add_filter( 'bbp_get_reply_permalink', 'bbp_add_view_all' );
 107  add_filter( 'bbp_get_forum_permalink', 'bbp_add_view_all' );
 108  
 109  // wp_filter_kses on new/edit forum/topic/reply title
 110  add_filter( 'bbp_new_forum_pre_title',  'wp_filter_kses' );
 111  add_filter( 'bbp_new_reply_pre_title',  'wp_filter_kses' );
 112  add_filter( 'bbp_new_topic_pre_title',  'wp_filter_kses' );
 113  add_filter( 'bbp_edit_forum_pre_title', 'wp_filter_kses' );
 114  add_filter( 'bbp_edit_reply_pre_title', 'wp_filter_kses' );
 115  add_filter( 'bbp_edit_topic_pre_title', 'wp_filter_kses' );
 116  
 117  // Prevent posting malicious or malformed content on new/edit topic/reply
 118  add_filter( 'bbp_new_reply_pre_content',  'bbp_encode_bad',  10 );
 119  add_filter( 'bbp_new_reply_pre_content',  'bbp_code_trick',  20 );
 120  add_filter( 'bbp_new_reply_pre_content',  'bbp_filter_kses', 30 );
 121  add_filter( 'bbp_new_reply_pre_content',  'balanceTags',     40 );
 122  add_filter( 'bbp_new_topic_pre_content',  'bbp_encode_bad',  10 );
 123  add_filter( 'bbp_new_topic_pre_content',  'bbp_code_trick',  20 );
 124  add_filter( 'bbp_new_topic_pre_content',  'bbp_filter_kses', 30 );
 125  add_filter( 'bbp_new_topic_pre_content',  'balanceTags',     40 );
 126  add_filter( 'bbp_new_forum_pre_content',  'bbp_encode_bad',  10 );
 127  add_filter( 'bbp_new_forum_pre_content',  'bbp_code_trick',  20 );
 128  add_filter( 'bbp_new_forum_pre_content',  'bbp_filter_kses', 30 );
 129  add_filter( 'bbp_new_forum_pre_content',  'balanceTags',     40 );
 130  add_filter( 'bbp_edit_reply_pre_content', 'bbp_encode_bad',  10 );
 131  add_filter( 'bbp_edit_reply_pre_content', 'bbp_code_trick',  20 );
 132  add_filter( 'bbp_edit_reply_pre_content', 'bbp_filter_kses', 30 );
 133  add_filter( 'bbp_edit_reply_pre_content', 'balanceTags',     40 );
 134  add_filter( 'bbp_edit_topic_pre_content', 'bbp_encode_bad',  10 );
 135  add_filter( 'bbp_edit_topic_pre_content', 'bbp_code_trick',  20 );
 136  add_filter( 'bbp_edit_topic_pre_content', 'bbp_filter_kses', 30 );
 137  add_filter( 'bbp_edit_topic_pre_content', 'balanceTags',     40 );
 138  add_filter( 'bbp_edit_forum_pre_content', 'bbp_encode_bad',  10 );
 139  add_filter( 'bbp_edit_forum_pre_content', 'bbp_code_trick',  20 );
 140  add_filter( 'bbp_edit_forum_pre_content', 'bbp_filter_kses', 30 );
 141  add_filter( 'bbp_edit_forum_pre_content', 'balanceTags',     40 );
 142  
 143  // No follow and wp_unslash on links
 144  add_filter( 'bbp_get_reply_author_link',      'bbp_rel_nofollow' );
 145  add_filter( 'bbp_get_reply_author_link',      'wp_unslash'       );
 146  add_filter( 'bbp_get_reply_to_link',          'bbp_rel_nofollow' );
 147  add_filter( 'bbp_get_reply_to_link',          'wp_unslash'       );
 148  add_filter( 'bbp_get_topic_author_link',      'bbp_rel_nofollow' );
 149  add_filter( 'bbp_get_topic_author_link',      'wp_unslash'       );
 150  add_filter( 'bbp_get_topic_reply_link',       'bbp_rel_nofollow' );
 151  add_filter( 'bbp_get_topic_reply_link',       'wp_unslash'       );
 152  add_filter( 'bbp_get_user_favorites_link',    'bbp_rel_nofollow' );
 153  add_filter( 'bbp_get_user_favorites_link',    'wp_unslash'       );
 154  add_filter( 'bbp_get_user_subscribe_link',    'bbp_rel_nofollow' );
 155  add_filter( 'bbp_get_user_subscribe_link',    'wp_unslash'       );
 156  add_filter( 'bbp_get_user_profile_link',      'bbp_rel_nofollow' );
 157  add_filter( 'bbp_get_user_profile_link',      'wp_unslash'       );
 158  add_filter( 'bbp_get_user_profile_edit_link', 'bbp_rel_nofollow' );
 159  add_filter( 'bbp_get_user_profile_edit_link', 'wp_unslash'       );
 160  add_filter( 'bbp_get_cancel_reply_to_link',   'bbp_rel_nofollow' );
 161  add_filter( 'bbp_get_cancel_reply_to_link',   'wp_unslash'       );
 162  
 163  // Run filters on reply content
 164  add_filter( 'bbp_get_reply_content', 'wptexturize',        6  );
 165  add_filter( 'bbp_get_reply_content', 'convert_chars',      8  );
 166  add_filter( 'bbp_get_reply_content', 'capital_P_dangit',   10 );
 167  add_filter( 'bbp_get_reply_content', 'convert_smilies',    20 );
 168  add_filter( 'bbp_get_reply_content', 'force_balance_tags', 30 );
 169  add_filter( 'bbp_get_reply_content', 'bbp_make_clickable', 40 );
 170  add_filter( 'bbp_get_reply_content', 'wpautop',            50 );
 171  add_filter( 'bbp_get_reply_content', 'bbp_rel_nofollow',   60 );
 172  
 173  // Run filters on topic content
 174  add_filter( 'bbp_get_topic_content', 'wptexturize',        6  );
 175  add_filter( 'bbp_get_topic_content', 'convert_chars',      8  );
 176  add_filter( 'bbp_get_topic_content', 'capital_P_dangit',   10 );
 177  add_filter( 'bbp_get_topic_content', 'convert_smilies',    20 );
 178  add_filter( 'bbp_get_topic_content', 'force_balance_tags', 30 );
 179  add_filter( 'bbp_get_topic_content', 'bbp_make_clickable', 40 );
 180  add_filter( 'bbp_get_topic_content', 'wpautop',            50 );
 181  add_filter( 'bbp_get_topic_content', 'bbp_rel_nofollow',   60 );
 182  
 183  // Admin-only
 184  if ( is_admin() ) {
 185  
 186      // Run wp_kses_data on topic/reply content in admin section
 187      add_filter( 'bbp_get_reply_content', 'bbp_kses_data' );
 188      add_filter( 'bbp_get_topic_content', 'bbp_kses_data' );
 189  
 190  // Filters outside of wp-admin
 191  } else {
 192  
 193      // Responsive images
 194      add_filter( 'bbp_get_reply_content', 'wp_make_content_images_responsive', 60 );
 195      add_filter( 'bbp_get_topic_content', 'wp_make_content_images_responsive', 60 );
 196  
 197      // Revisions
 198      add_filter( 'bbp_get_reply_content', 'bbp_reply_content_append_revisions',  99,  2 );
 199      add_filter( 'bbp_get_topic_content', 'bbp_topic_content_append_revisions',  99,  2 );
 200  }
 201  
 202  // Form textarea output - undo the code-trick done pre-save, and sanitize
 203  add_filter( 'bbp_get_form_forum_content', 'bbp_code_trick_reverse' );
 204  add_filter( 'bbp_get_form_forum_content', 'esc_textarea'           );
 205  add_filter( 'bbp_get_form_forum_content', 'trim'                   );
 206  add_filter( 'bbp_get_form_topic_content', 'bbp_code_trick_reverse' );
 207  add_filter( 'bbp_get_form_topic_content', 'esc_textarea'           );
 208  add_filter( 'bbp_get_form_topic_content', 'trim'                   );
 209  add_filter( 'bbp_get_form_reply_content', 'bbp_code_trick_reverse' );
 210  add_filter( 'bbp_get_form_reply_content', 'esc_textarea'           );
 211  add_filter( 'bbp_get_form_reply_content', 'trim'                   );
 212  
 213  // Form input/output - sanitize
 214  add_filter( 'bbp_get_form_reply_edit_reason', 'esc_attr' );
 215  add_filter( 'bbp_get_form_reply_edit_reason', 'trim'     );
 216  add_filter( 'bbp_get_form_topic_edit_reason', 'esc_attr' );
 217  add_filter( 'bbp_get_form_topic_edit_reason', 'trim'     );
 218  add_filter( 'bbp_get_form_topic_title',       'esc_attr' );
 219  add_filter( 'bbp_get_form_topic_title',       'trim'     );
 220  add_filter( 'bbp_get_form_topic_tags',        'esc_attr' );
 221  add_filter( 'bbp_get_form_topic_tags',        'trim'     );
 222  add_filter( 'bbp_get_form_forum_type',        'esc_attr' );
 223  add_filter( 'bbp_get_form_forum_type',        'trim'     );
 224  add_filter( 'bbp_get_form_forum_visibility',  'esc_attr' );
 225  add_filter( 'bbp_get_form_forum_visibility',  'trim'     );
 226  add_filter( 'bbp_get_form_forum_moderators',  'esc_attr' );
 227  add_filter( 'bbp_get_form_forum_moderators',  'trim'     );
 228  add_filter( 'bbp_get_form_topic_forum',       'intval'   );
 229  add_filter( 'bbp_get_form_forum_parent',      'intval'   );
 230  add_filter( 'bbp_get_form_reply_to',          'intval'   );
 231  
 232  // Add number format filter to functions requesting formatted values
 233  add_filter( 'bbp_get_user_topic_count',         'bbp_number_format', 10 );
 234  add_filter( 'bbp_get_user_reply_count',         'bbp_number_format', 10 );
 235  add_filter( 'bbp_get_user_post_count',          'bbp_number_format', 10 );
 236  add_filter( 'bbp_get_forum_subforum_count',     'bbp_number_format', 10 );
 237  add_filter( 'bbp_get_forum_topic_count',        'bbp_number_format', 10 );
 238  add_filter( 'bbp_get_forum_reply_count',        'bbp_number_format', 10 );
 239  add_filter( 'bbp_get_forum_post_count',         'bbp_number_format', 10 );
 240  add_filter( 'bbp_get_topic_voice_count',        'bbp_number_format', 10 );
 241  add_filter( 'bbp_get_topic_reply_count',        'bbp_number_format', 10 );
 242  add_filter( 'bbp_get_topic_post_count',         'bbp_number_format', 10 );
 243  add_filter( 'bbp_get_topic_revision_count',     'bbp_number_format', 10 );
 244  add_filter( 'bbp_get_reply_revision_count',     'bbp_number_format', 10 );
 245  add_filter( 'bbp_get_forum_topic_count_hidden', 'bbp_number_format', 10 );
 246  add_filter( 'bbp_get_topic_reply_count_hidden', 'bbp_number_format', 10 );
 247  
 248  // Add number-not-negative filter to values that can never be negative numbers
 249  add_filter( 'bbp_get_user_topic_count',             'bbp_number_not_negative', 8 );
 250  add_filter( 'bbp_get_user_reply_count',             'bbp_number_not_negative', 8 );
 251  add_filter( 'bbp_get_user_post_count',              'bbp_number_not_negative', 8 );
 252  add_filter( 'bbp_get_forum_subforum_count',         'bbp_number_not_negative', 8 );
 253  add_filter( 'bbp_get_forum_topic_count',            'bbp_number_not_negative', 8 );
 254  add_filter( 'bbp_get_forum_reply_count',            'bbp_number_not_negative', 8 );
 255  add_filter( 'bbp_get_forum_post_count',             'bbp_number_not_negative', 8 );
 256  add_filter( 'bbp_get_topic_voice_count',            'bbp_number_not_negative', 8 );
 257  add_filter( 'bbp_get_topic_reply_count',            'bbp_number_not_negative', 8 );
 258  add_filter( 'bbp_get_topic_post_count',             'bbp_number_not_negative', 8 );
 259  add_filter( 'bbp_get_forum_topic_count_hidden',     'bbp_number_not_negative', 8 );
 260  add_filter( 'bbp_get_topic_reply_count_hidden',     'bbp_number_not_negative', 8 );
 261  add_filter( 'bbp_get_topic_revision_count',         'bbp_number_not_negative', 8 );
 262  add_filter( 'bbp_get_reply_revision_count',         'bbp_number_not_negative', 8 );
 263  add_filter( 'bbp_get_user_topic_count_int',         'bbp_number_not_negative', 8 );
 264  add_filter( 'bbp_get_user_reply_count_int',         'bbp_number_not_negative', 8 );
 265  add_filter( 'bbp_get_user_post_count_int',          'bbp_number_not_negative', 8 );
 266  add_filter( 'bbp_get_forum_subforum_count_int',     'bbp_number_not_negative', 8 );
 267  add_filter( 'bbp_get_forum_topic_count_int',        'bbp_number_not_negative', 8 );
 268  add_filter( 'bbp_get_forum_reply_count_int',        'bbp_number_not_negative', 8 );
 269  add_filter( 'bbp_get_forum_post_count_int',         'bbp_number_not_negative', 8 );
 270  add_filter( 'bbp_get_topic_voice_count_int',        'bbp_number_not_negative', 8 );
 271  add_filter( 'bbp_get_topic_reply_count_int',        'bbp_number_not_negative', 8 );
 272  add_filter( 'bbp_get_topic_post_count_int',         'bbp_number_not_negative', 8 );
 273  add_filter( 'bbp_get_forum_topic_count_hidden_int', 'bbp_number_not_negative', 8 );
 274  add_filter( 'bbp_get_topic_reply_count_hidden_int', 'bbp_number_not_negative', 8 );
 275  add_filter( 'bbp_get_topic_revision_count_int',     'bbp_number_not_negative', 8 );
 276  add_filter( 'bbp_get_reply_revision_count_int',     'bbp_number_not_negative', 8 );
 277  
 278  // Sanitize displayed user data
 279  add_filter( 'bbp_get_displayed_user_field', 'bbp_sanitize_displayed_user_field', 10, 3 );
 280  
 281  // Suppress private forum details
 282  add_filter( 'bbp_get_forum_topic_count',    'bbp_suppress_private_forum_meta',  10, 2 );
 283  add_filter( 'bbp_get_forum_reply_count',    'bbp_suppress_private_forum_meta',  10, 2 );
 284  add_filter( 'bbp_get_forum_post_count',     'bbp_suppress_private_forum_meta',  10, 2 );
 285  add_filter( 'bbp_get_forum_freshness_link', 'bbp_suppress_private_forum_meta',  10, 2 );
 286  add_filter( 'bbp_get_author_link',          'bbp_suppress_private_author_link', 10, 2 );
 287  add_filter( 'bbp_get_topic_author_link',    'bbp_suppress_private_author_link', 10, 2 );
 288  add_filter( 'bbp_get_reply_author_link',    'bbp_suppress_private_author_link', 10, 2 );
 289  
 290  // Allow private & hidden forum details for moderators
 291  add_filter( 'bbp_get_excluded_forum_ids', 'bbp_allow_forums_of_user', 10, 2 );
 292  
 293  // Topic and reply author display names
 294  add_filter( 'bbp_get_topic_author_display_name', 'wptexturize'   );
 295  add_filter( 'bbp_get_topic_author_display_name', 'convert_chars' );
 296  add_filter( 'bbp_get_topic_author_display_name', 'esc_html'      );
 297  add_filter( 'bbp_get_reply_author_display_name', 'wptexturize'   );
 298  add_filter( 'bbp_get_reply_author_display_name', 'convert_chars' );
 299  add_filter( 'bbp_get_reply_author_display_name', 'esc_html'      );
 300  
 301  /**
 302   * Add filters to anonymous post author data
 303   */
 304  // Post author name
 305  add_filter( 'bbp_pre_anonymous_post_author_name',    'trim',                10 );
 306  add_filter( 'bbp_pre_anonymous_post_author_name',    'sanitize_text_field', 10 );
 307  add_filter( 'bbp_pre_anonymous_post_author_name',    'wp_filter_kses',      10 );
 308  add_filter( 'bbp_pre_anonymous_post_author_name',    '_wp_specialchars',    30 );
 309  
 310  // Save email
 311  add_filter( 'bbp_pre_anonymous_post_author_email',   'trim',                10 );
 312  add_filter( 'bbp_pre_anonymous_post_author_email',   'sanitize_email',      10 );
 313  add_filter( 'bbp_pre_anonymous_post_author_email',   'wp_filter_kses',      10 );
 314  
 315  // Save URL
 316  add_filter( 'bbp_pre_anonymous_post_author_website', 'trim',                10 );
 317  add_filter( 'bbp_pre_anonymous_post_author_website', 'wp_strip_all_tags',   10 );
 318  add_filter( 'bbp_pre_anonymous_post_author_website', 'esc_url_raw',         10 );
 319  add_filter( 'bbp_pre_anonymous_post_author_website', 'wp_filter_kses',      10 );
 320  
 321  // Queries
 322  add_filter( 'posts_request', '_bbp_has_replies_where', 10, 2 );
 323  
 324  // Capabilities
 325  add_filter( 'bbp_map_meta_caps', 'bbp_map_primary_meta_caps',   10, 4 ); // Primary caps
 326  add_filter( 'bbp_map_meta_caps', 'bbp_map_forum_meta_caps',     10, 4 ); // Forums
 327  add_filter( 'bbp_map_meta_caps', 'bbp_map_topic_meta_caps',     10, 4 ); // Topics
 328  add_filter( 'bbp_map_meta_caps', 'bbp_map_topic_tag_meta_caps', 10, 4 ); // Topic tags
 329  add_filter( 'bbp_map_meta_caps', 'bbp_map_reply_meta_caps',     10, 4 ); // Replies
 330  
 331  // Clickables
 332  add_filter( 'bbp_make_clickable', 'bbp_make_urls_clickable',      2 ); // https://bbpress.org
 333  add_filter( 'bbp_make_clickable', 'bbp_make_ftps_clickable',      4 ); // ftps://bbpress.org
 334  add_filter( 'bbp_make_clickable', 'bbp_make_emails_clickable',    6 ); // jjj@bbpress.org
 335  add_filter( 'bbp_make_clickable', 'bbp_make_mentions_clickable',  8 ); // @jjj
 336  
 337  /** Deprecated ****************************************************************/
 338  
 339  /**
 340   * The following filters are deprecated.
 341   *
 342   * These filters were most likely replaced by bbp_parse_args(), which includes
 343   * both passive and aggressive filters anywhere parse_args is used to compare
 344   * default arguments to passed arguments, without sprinkling the project with
 345   * _before_ and _after_ filters everywhere.
 346   */
 347  
 348  /**
 349   * Deprecated locale filter
 350   *
 351   * @since 2.2.0 bbPress (r4213)
 352   *
 353   * @param string $locale
 354   * @return string  $domain
 355   */
 356  function _bbp_filter_locale( $locale = '', $domain = '' ) {
 357  
 358      // Only apply to the bbPress text-domain
 359      if ( bbpress()->domain !== $domain ) {
 360          return $locale;
 361      }
 362  
 363      return apply_filters( 'bbpress_locale', $locale, $domain );
 364  }
 365  add_filter( 'bbp_plugin_locale', '_bbp_filter_locale', 10, 1 );
 366  
 367  /**
 368   * Deprecated forums query filter
 369   *
 370   * @since 2.1.0 bbPress (r3961)
 371   *
 372   * @param array $args
 373   * @return array
 374   */
 375  function _bbp_has_forums_query( $args = array() ) {
 376  
 377      // Filter & return
 378      return (array) apply_filters( 'bbp_has_forums_query', $args );
 379  }
 380  add_filter( 'bbp_after_has_forums_parse_args', '_bbp_has_forums_query' );
 381  
 382  /**
 383   * Deprecated topics query filter
 384   *
 385   * @since 2.1.0 bbPress (r3961)
 386   *
 387   * @param array $args
 388   * @return array
 389   */
 390  function _bbp_has_topics_query( $args = array() ) {
 391  
 392      // Filter & return
 393      return (array) apply_filters( 'bbp_has_topics_query', $args );
 394  }
 395  add_filter( 'bbp_after_has_topics_parse_args', '_bbp_has_topics_query' );
 396  
 397  /**
 398   * Deprecated replies query filter
 399   *
 400   * @since 2.1.0 bbPress (r3961)
 401   *
 402   * @param array $args
 403   * @return array
 404   */
 405  function _bbp_has_replies_query( $args = array() ) {
 406  
 407      // Filter & return
 408      return (array) apply_filters( 'bbp_has_replies_query', $args );
 409  }
 410  add_filter( 'bbp_after_has_replies_parse_args', '_bbp_has_replies_query' );


Generated: Tue Jun 2 01:01:19 2020 Cross-referenced by PHPXref 0.7.1