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


Generated: Wed Feb 28 01:00:50 2024 Cross-referenced by PHPXref 0.7.1