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/replies/functions.php

    r6415 r6438  
    7777    do_action( 'bbp_insert_reply', (int) $reply_id, (int) $reply_meta['topic_id'], (int) $reply_meta['forum_id'] );
    7878
    79     // Return new reply ID
     79    // Return reply_id
    8080    return $reply_id;
    8181}
     
    10891089    $forum_id = bbp_update_forum_id( $reply_id, $forum_id );
    10901090
     1091    // Filter & return
    10911092    return (int) apply_filters( 'bbp_update_reply_forum_id', $forum_id, $reply_id );
    10921093}
     
    11381139    $topic_id = bbp_update_topic_id( $reply_id, $topic_id );
    11391140
     1141    // Filter & return
    11401142    return (int) apply_filters( 'bbp_update_reply_topic_id', $topic_id, $reply_id );
    11411143}
     
    11731175    }
    11741176
     1177    // Filter & return
    11751178    return (int) apply_filters( 'bbp_update_reply_to', $reply_to, $reply_id );
    11761179}
     
    12221225    }
    12231226
     1227    // Filter & return
    12241228    return (array) apply_filters( 'bbp_get_reply_ancestors', $ancestors, $reply_id );
    12251229}
     
    12641268    update_post_meta( $r['reply_id'], '_bbp_revision_log', $revision_log );
    12651269
     1270    // Filter & return
    12661271    return apply_filters( 'bbp_update_reply_revision_log', $revision_log, $r['reply_id'] );
    12671272}
     
    17651770 */
    17661771function bbp_get_reply_statuses( $reply_id = 0 ) {
    1767     return apply_filters( 'bbp_get_reply_statuses', array(
     1772
     1773    // Filter & return
     1774    return (array) apply_filters( 'bbp_get_reply_statuses', array(
    17681775        bbp_get_public_status_id()  => _x( 'Publish', 'Publish the reply',     'bbpress' ),
    17691776        bbp_get_spam_status_id()    => _x( 'Spam',    'Spam the reply',        'bbpress' ),
     
    17831790 */
    17841791function bbp_get_reply_toggles( $reply_id = 0 ) {
    1785     return apply_filters( 'bbp_get_toggle_reply_actions', array(
     1792
     1793    // Filter & return
     1794    return (array) apply_filters( 'bbp_get_toggle_reply_actions', array(
    17861795        'bbp_toggle_reply_spam',
    17871796        'bbp_toggle_reply_trash',
     
    21152124    }
    21162125
    2117     // Filter and return
     2126    // Filter & return
    21182127    return (int) apply_filters( 'bbp_get_replies_per_page', $retval, $default );
    21192128}
     
    21392148    }
    21402149
    2141     // Filter and return
     2150    // Filter & return
    21422151    return (int) apply_filters( 'bbp_get_replies_per_rss_page', $retval, $default );
    21432152}
     
    25132522    }
    25142523
     2524    // Filter & return
    25152525    return (bool) apply_filters( 'bbp_thread_replies', $retval, $depth, $allow );
    25162526}
Note: See TracChangeset for help on using the changeset viewer.