bbp_get_forum_topic_count

  • apply_filters( 'bbp_get_forum_topic_count', (int) $topics, $forum_id )

    Source Reference:

    • Component: bbPress :: bbp-forum
      File: /bbp-includes/bbp-forum-template.php :: Trac Source Line: 1169
      	 * @uses get_post_meta() To get the forum topic count
      	 * @uses apply_filters() Calls 'bbp_get_forum_topic_count' with the
      	 *                        topic count and forum id
      	 * @return int Forum topic count
      	 */
      	function bbp_get_forum_topic_count( $forum_id = 0, $total_count = true ) {
      		$forum_id = bbp_get_forum_id( $forum_id );
      		$topics   = get_post_meta( $forum_id, empty( $total_count ) ? '_bbp_topic_count' : '_bbp_total_topic_count', true );
      
      		return apply_filters( 'bbp_get_forum_topic_count', (int) $topics, $forum_id );
      	}
      
      /**
       * Output total reply count of a forum
       *
       * @since bbPress (r2464)
       *
       * @param int $forum_id Optional. Forum id
       * @param bool $total_count Optional. To get the total count or normal count?
       * @uses bbp_get_forum_reply_count() To get the forum reply count
      

Hook: add_filter: bbp_get_forum_topic_count instances (2)

  • add_filter( 'bbp_get_forum_topic_count',       'bbp_number_format' )
    $tag: bbp_get_forum_topic_count
    $function_to_add: bbp_number_format
    $priority: 0
    $accepted_args: 0

    Source Reference:

    • Component: bbPress :: bbp-core
      File: /bbp-includes/bbp-core-hooks.php :: Trac Source Line: 305
      add_filter( 'bbp_new_topic_pre_content',  'wp_filter_kses'  );
      add_filter( 'bbp_edit_reply_pre_content', 'balanceTags'     );
      add_filter( 'bbp_edit_reply_pre_content', 'wp_rel_nofollow' );
      add_filter( 'bbp_edit_reply_pre_content', 'wp_filter_kses'  );
      add_filter( 'bbp_edit_topic_pre_content', 'balanceTags'     );
      add_filter( 'bbp_edit_topic_pre_content', 'wp_rel_nofollow' );
      add_filter( 'bbp_edit_topic_pre_content', 'wp_filter_kses'  );
      
      // Add number format filter to functions requiring numeric output
      add_filter( 'bbp_get_forum_topic_count',       'bbp_number_format' );
      add_filter( 'bbp_get_forum_topic_reply_count', 'bbp_number_format' );
      
      // No follow and stripslashes on user profile links
      add_filter( 'bbp_get_reply_author_link',      'wp_rel_nofollow' );
      add_filter( 'bbp_get_reply_author_link',      'stripslashes'    );
      add_filter( 'bbp_get_topic_author_link',      'wp_rel_nofollow' );
      add_filter( 'bbp_get_topic_author_link',      'stripslashes'    );
      add_filter( 'bbp_get_user_favorites_link',    'wp_rel_nofollow' );
      add_filter( 'bbp_get_user_favorites_link',    'stripslashes'    );
      add_filter( 'bbp_get_user_subscribe_link',    'wp_rel_nofollow' );
      
  • add_filter( 'bbp_get_forum_topic_count',    'bbp_suppress_private_forum_meta',  10, 2 )
    $tag: bbp_get_forum_topic_count
    $function_to_add: bbp_suppress_private_forum_meta
    $priority: 10
    $accepted_args: 2

    Source Reference:

    • Component: bbPress :: bbp-core
      File: /bbp-includes/bbp-core-hooks.php :: Trac Source Line: 355
      // Login/Register/Lost Password
      add_filter( 'login_redirect', 'bbp_redirect_login', 2, 3 );
      add_filter( 'logout_url',     'bbp_logout_url',     2, 2 );
      
      // Fix post author id for anonymous posts (set it back to 0) when the post status is changed
      add_filter( 'wp_insert_post_data', 'bbp_fix_post_author', 30, 2 );
      
      // Suppress private forum details
      add_filter( 'bbp_get_forum_topic_count',    'bbp_suppress_private_forum_meta',  10, 2 );
      add_filter( 'bbp_get_forum_reply_count',    'bbp_suppress_private_forum_meta',  10, 2 );
      add_filter( 'bbp_get_forum_post_count',     'bbp_suppress_private_forum_meta',  10, 2 );
      add_filter( 'bbp_get_forum_freshness_link', 'bbp_suppress_private_forum_meta',  10, 2 );
      add_filter( 'bbp_get_author_link',          'bbp_suppress_private_author_link', 10, 2 );
      add_filter( 'bbp_get_topic_author_link',    'bbp_suppress_private_author_link', 10, 2 );
      add_filter( 'bbp_get_reply_author_link',    'bbp_suppress_private_author_link', 10, 2 );
      
      /**
       * Add filters to anonymous post author data
       *
      

Comments are closed.