Skip to:
Content

bbPress.org


Ignore:
Timestamp:
05/27/2017 05:04:31 PM (7 years ago)
Author:
johnjamesjacoby
Message:

Tools: Add //Filter & return note for future discovery of missing filter documentation.

Also adjust some type-casting on filtered results.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/forums/functions.php

    r6434 r6438  
    8383    do_action( 'bbp_insert_forum', (int) $forum_id );
    8484
    85     // Return new forum ID
     85    // Return forum_id
    8686    return $forum_id;
    8787}
     
    11671167    $forum_topic_count = (int) ( $total_topic_count + $difference );
    11681168
     1169    // Filter & return
    11691170    return (int) apply_filters( 'bbp_bump_forum_topic_count', $forum_topic_count, $forum_id, $difference, $update_ancestors );
    11701171}
     
    12671268    update_post_meta( $forum_id, '_bbp_topic_count_hidden', $new_count );
    12681269
     1270    // Filter & return
    12691271    return (int) apply_filters( 'bbp_bump_forum_topic_count_hidden', $new_count, $forum_id, $difference );
    12701272}
     
    13851387    $forum_reply_count = (int) ( $total_reply_count + $difference );
    13861388
     1389    // Filter & return
    13871390    return (int) apply_filters( 'bbp_bump_forum_reply_count', $forum_reply_count, $forum_id, $difference, $update_ancestors );
    13881391}
     
    15541557    }
    15551558
     1559    // Filter & return
    15561560    return (int) apply_filters( 'bbp_update_forum_last_topic_id', $topic_id, $forum_id );
    15571561}
     
    16191623    }
    16201624
     1625    // Filter & return
    16211626    return (int) apply_filters( 'bbp_update_forum_last_reply_id', $reply_id, $forum_id );
    16221627}
     
    16861691    }
    16871692
     1693    // Filter & return
    16881694    return (int) apply_filters( 'bbp_update_forum_last_active_id', $active_id, $forum_id );
    16891695}
     
    17171723    }
    17181724
     1725    // Filter & return
    17191726    return apply_filters( 'bbp_update_forum_last_active', $new_time, $forum_id );
    17201727}
     
    17401747    update_post_meta( $forum_id, '_bbp_forum_subforum_count', $subforums );
    17411748
     1749    // Filter & return
    17421750    return (int) apply_filters( 'bbp_update_forum_subforum_count', $subforums, $forum_id );
    17431751}
     
    17841792    update_post_meta( $forum_id, '_bbp_total_topic_count', $total_topics );
    17851793
     1794    // Filter & return
    17861795    return (int) apply_filters( 'bbp_update_forum_topic_count', $total_topics, $forum_id );
    17871796}
     
    18491858    }
    18501859
     1860    // Filter & return
    18511861    return (int) apply_filters( 'bbp_update_forum_topic_count_hidden', $topic_count, $forum_id );
    18521862}
     
    19131923    update_post_meta( $forum_id, '_bbp_total_reply_count', $total_replies );
    19141924
     1925    // Filter & return
    19151926    return (int) apply_filters( 'bbp_update_forum_reply_count', $total_replies, $forum_id );
    19161927}
     
    20012012 */
    20022013function bbp_get_forum_statuses( $forum_id = 0 ) {
    2003     return apply_filters( 'bbp_get_forum_statuses', array(
     2014
     2015    // Filter & return
     2016    return (array) apply_filters( 'bbp_get_forum_statuses', array(
    20042017        'open'   => _x( 'Open',    'Open the forum',  'bbpress' ),
    20052018        'closed' => _x( 'Closed',  'Close the forum', 'bbpress' )
     
    20172030 */
    20182031function bbp_get_forum_types( $forum_id = 0 ) {
    2019     return apply_filters( 'bbp_get_forum_types', array(
     2032
     2033    // Filter & return
     2034    return (array) apply_filters( 'bbp_get_forum_types', array(
    20202035        'forum'    => _x( 'Forum',    'Forum accepts new topics', 'bbpress' ),
    20212036        'category' => _x( 'Category', 'Forum is a category',      'bbpress' )
     
    20332048 */
    20342049function bbp_get_forum_visibilities( $forum_id = 0) {
    2035     return apply_filters( 'bbp_get_forum_visibilities', array(
     2050
     2051    // Filter & return
     2052    return (array) apply_filters( 'bbp_get_forum_visibilities', array(
    20362053        bbp_get_public_status_id()  => _x( 'Public',  'Make forum public',  'bbpress' ),
    20372054        bbp_get_private_status_id() => _x( 'Private', 'Make forum private', 'bbpress' ),
     
    20602077        : array();
    20612078
    2062     return apply_filters( 'bbp_get_hidden_forum_ids', (array) $forum_ids );
     2079    // Filter & return
     2080    return (array) apply_filters( 'bbp_get_hidden_forum_ids', $forum_ids );
    20632081}
    20642082
     
    20812099        : array();
    20822100
    2083     return apply_filters( 'bbp_get_private_forum_ids', (array) $forum_ids );
     2101    // Filter & return
     2102    return (array) apply_filters( 'bbp_get_private_forum_ids', $forum_ids );
    20842103}
    20852104
     
    21772196    }
    21782197
    2179     // Filter and return the results
     2198    // Filter & return
    21802199    return apply_filters( 'bbp_exclude_forum_ids', $retval, $forum_ids, $type );
    21812200}
     
    23062325    $topic_ids = bbp_get_public_child_ids( $forum_id, bbp_get_topic_post_type() );
    23072326
     2327    // Filter & return
    23082328    return (array) apply_filters( 'bbp_forum_query_topic_ids', $topic_ids, $forum_id );
    23092329}
     
    23252345    $subforum_ids = bbp_get_all_child_ids( $forum_id, bbp_get_forum_post_type() );
    23262346
     2347    // Filter & return
    23272348    return (array) apply_filters( 'bbp_forum_query_subforum_ids', $subforum_ids, $forum_id );
    23282349}
     
    23732394    unset( $query );
    23742395
     2396    // Filter & return
    23752397    return (int) apply_filters( 'bbp_forum_query_last_reply_id', $reply_id, $forum_id );
    23762398}
Note: See TracChangeset for help on using the changeset viewer.