Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/21/2015 12:13:52 AM (11 years ago)
Author:
tw2113
Message:

Add hook documentation to BP Forums component.

Fixes #5941.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-forums/bp-forums-functions.php

    r9351 r9383  
    8080 */
    8181function bp_forums_get_forum( $forum_id ) {
     82
     83    /** This action is documented in bp-forums/bp-forums-screens */
    8284    do_action( 'bbpress_init' );
    8385    return bb_get_forum( $forum_id );
     
    101103 */
    102104function bp_forums_new_forum( $args = '' ) {
     105
     106    /** This action is documented in bp-forums/bp-forums-screens */
    103107    do_action( 'bbpress_init' );
    104108
     
    133137 */
    134138function bp_forums_update_forum( $args = '' ) {
     139
     140    /** This action is documented in bp-forums/bp-forums-screens */
    135141    do_action( 'bbpress_init' );
    136142
     
    158164
    159165    if ( !empty( $forum_id ) && is_int( $forum_id ) ) {
     166
     167        /** This action is documented in bp-forums/bp-forums-screens */
    160168        do_action( 'bbpress_init' );
    161169        bb_delete_forum( $forum_id );
     
    189197 */
    190198function bp_forums_get_forum_topics( $args = '' ) {
     199
     200    /** This action is documented in bp-forums/bp-forums-screens */
    191201    do_action( 'bbpress_init' );
    192202
     
    231241    }
    232242
     243    /**
     244     * Filters the found forum topics for provided arguments.
     245     *
     246     * @since BuddyPress (1.1.0)
     247     *
     248     * @param array $topics Array of found topics. Passed by reference.
     249     * @param array $r      Array of parsed arguments for query. Passed by reference.
     250     */
    233251    return apply_filters_ref_array( 'bp_forums_get_forum_topics', array( &$topics, &$r ) );
    234252}
     
    241259 */
    242260function bp_forums_get_topic_details( $topic_id ) {
     261
     262    /** This action is documented in bp-forums/bp-forums-screens */
    243263    do_action( 'bbpress_init' );
    244264
     
    257277 */
    258278function bp_forums_get_topic_id_from_slug( $topic_slug ) {
     279
     280    /** This action is documented in bp-forums/bp-forums-screens */
    259281    do_action( 'bbpress_init' );
    260282
     
    296318    global $bp;
    297319
     320    /** This action is documented in bp-forums/bp-forums-screens */
    298321    do_action( 'bbpress_init' );
    299322
     
    335358        return false;
    336359
     360    /**
     361     * Fires after a new forum topic has been created.
     362     *
     363     * @since BuddyPress (1.0.0)
     364     *
     365     * @param int $topic_id ID of the newly created topic post.
     366     */
    337367    do_action( 'bp_forums_new_topic', $topic_id );
    338368
     
    355385 */
    356386function bp_forums_update_topic( $args = '' ) {
     387
     388    /** This action is documented in bp-forums/bp-forums-screens */
    357389    do_action( 'bbpress_init' );
    358390
     
    386418
    387419function bp_forums_sticky_topic( $args = '' ) {
     420
     421    /** This action is documented in bp-forums/bp-forums-screens */
    388422    do_action( 'bbpress_init' );
    389423
     
    413447 */
    414448function bp_forums_openclose_topic( $args = '' ) {
     449
     450    /** This action is documented in bp-forums/bp-forums-screens */
    415451    do_action( 'bbpress_init' );
    416452
     
    438474 */
    439475function bp_forums_delete_topic( $args = '' ) {
     476
     477    /** This action is documented in bp-forums/bp-forums-screens */
    440478    do_action( 'bbpress_init' );
    441479
     
    456494    global $bbdb;
    457495
     496    /** This action is documented in bp-forums/bp-forums-screens */
    458497    do_action( 'bbpress_init' );
    459498
     
    472511    }
    473512
     513    /**
     514     * Filters the total topic count for the site.
     515     *
     516     * @since BuddyPress (1.5.0)
     517     *
     518     * @param int $count Total topic count.
     519     */
    474520    return apply_filters( 'bp_forums_total_topic_count', $count );
    475521}
     
    492538
    493539    if ( $text && $topic_id && $user_id ) {
     540
     541        /** This action is documented in bp-forums/bp-forums-screens */
    494542        do_action( 'bbpress_init' );
    495543
     
    513561    }
    514562
     563    /**
     564     * Filters whether a user has already left this particular reply on a given post.
     565     *
     566     * @since BuddyPress (1.6.0)
     567     *
     568     * @param bool   $reply_exists Whether or not a reply exists.
     569     * @param string $text         The text of the comment.
     570     * @param int    $topic_id     The topic ID.
     571     * @param int    $user_id      The user ID.
     572     */
    515573    return (bool) apply_filters( 'bp_forums_reply_exists', $reply_exists, $text, $topic_id, $user_id );
    516574}
     
    540598 */
    541599function bp_forums_total_topic_count_for_user( $user_id = 0, $type = 'active' ) {
     600
     601    /** This action is documented in bp-forums/bp-forums-screens */
    542602    do_action( 'bbpress_init' );
    543603
     
    579639 */
    580640function bp_forums_total_replied_count_for_user( $user_id = 0, $type = 'active' ) {
     641
     642    /** This action is documented in bp-forums/bp-forums-screens */
    581643    do_action( 'bbpress_init' );
    582644
     
    610672    }
    611673
     674    /**
     675     * Filters the total number of topics replied to by a given user.
     676     *
     677     * @since BuddyPress (1.5.0)
     678     *
     679     * @param int $count   Total number of topics replied to by a given user.
     680     * @param int $user_id The user ID.
     681     */
    612682    return apply_filters( 'bp_forums_total_replied_count_for_user', $count, $user_id );
    613683}
     
    694764 */
    695765function bp_forums_get_topic_posts( $args = '' ) {
     766
     767    /** This action is documented in bp-forums/bp-forums-screens */
    696768    do_action( 'bbpress_init' );
    697769
     
    718790 */
    719791function bp_forums_get_post( $post_id ) {
     792
     793    /** This action is documented in bp-forums/bp-forums-screens */
    720794    do_action( 'bbpress_init' );
    721795    return bb_get_post( $post_id );
     
    733807 */
    734808function bp_forums_delete_post( $args = '' ) {
     809
     810    /** This action is documented in bp-forums/bp-forums-screens */
    735811    do_action( 'bbpress_init' );
    736812
     
    764840 */
    765841function bp_forums_insert_post( $args = '' ) {
     842
     843    /** This action is documented in bp-forums/bp-forums-screens */
    766844    do_action( 'bbpress_init' );
    767845
     
    803881    $post_id = bb_insert_post( array( 'post_id' => $post_id, 'topic_id' => $topic_id, 'post_text' => stripslashes( trim( $post_text ) ), 'post_time' => $post_time, 'poster_id' => $poster_id, 'poster_ip' => $poster_ip, 'post_status' => $post_status, 'post_position' => $post_position ) );
    804882
    805     if ( !empty( $post_id ) )
     883    if ( !empty( $post_id ) ) {
     884
     885        /**
     886         * Fires if there was a new post created.
     887         *
     888         * @since BuddyPress (1.0.0)
     889         *
     890         * @param int $post_id ID of the newly created forum post.
     891         */
    806892        do_action( 'bp_forums_new_post', $post_id );
     893    }
    807894
    808895    return $post_id;
     
    854941    }
    855942
     943    /**
     944     * Filters BP-specific details about a set of posts.
     945     *
     946     * @since BuddyPress (1.5.0)
     947     *
     948     * @param array $posts Array of posts holding BP-specific details.
     949     */
    856950    return apply_filters( 'bp_forums_get_post_extras', $posts );
    857951}
     
    867961    global $wpdb, $bbdb;
    868962
     963    /** This action is documented in bp-forums/bp-forums-screens */
    869964    do_action( 'bbpress_init' );
    870965
     
    9061001 */
    9071002function bp_forums_parent_forum_id() {
     1003
     1004    /**
     1005     * Filters the parent forum ID for the bbPress abstraction layer.
     1006     *
     1007     * @since BuddyPress (1.5.0)
     1008     *
     1009     * @param int BP_FORUMS_PARENT_FORUM_ID The Parent forum ID constant.
     1010     */
    9081011    return apply_filters( 'bp_forums_parent_forum_id', BP_FORUMS_PARENT_FORUM_ID );
    9091012}
     
    9211024 */
    9221025function bp_forums_enable_global_directory_stickies() {
     1026
     1027    /**
     1028     * Filters whether or not sticky topics should be broken out of regular topic order.
     1029     *
     1030     * @since BuddyPress (1.5.0)
     1031     *
     1032     * @param bool $value Whether or not to break out of topic order.
     1033     */
    9231034    return apply_filters( 'bp_forums_enable_global_directory_stickies', defined( 'BP_FORUMS_ENABLE_GLOBAL_DIRECTORY_STICKIES' ) && BP_FORUMS_ENABLE_GLOBAL_DIRECTORY_STICKIES );
    9241035}
     
    9651076 *
    9661077 * @package BuddyPress_Forums
    967  * @since BuddyPress (1.5)
     1078 * @since BuddyPress (1.5.0)
    9681079 */
    9691080function bp_embed_forum_cache( $cache, $id, $cachekey ) {
Note: See TracChangeset for help on using the changeset viewer.