Skip to:
Content

BuddyPress.org

Changeset 9384


Ignore:
Timestamp:
01/21/2015 01:01:04 AM (7 years ago)
Author:
tw2113
Message:

Add hooks docs for newly added hooks in 2.2.0.

See #5669.

Location:
trunk/src/bp-activity
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/bp-activity-actions.php

    r9351 r9384  
    805805        // Untrashing the post type - nothing here yet.
    806806        if ( 'trash' == $old_status ) {
     807
     808            /**
     809             * Fires if untrashing post in a post type.
     810             *
     811             * This is a variable filter that is dependent on the post type
     812             * being untrashed.
     813             *
     814             * @since BuddyPress (2.2.0)
     815             *
     816             * @param WP_Post $post Post data.
     817             */
    807818            do_action( 'bp_activity_post_type_untrash_' . $post->post_type, $post );
    808819        } else {
  • trunk/src/bp-activity/bp-activity-functions.php

    r9382 r9384  
    485485    }
    486486
     487    /**
     488     * Filters tracking arguments for a specific post type.
     489     *
     490     * @since BuddyPress (2.2.0)
     491     *
     492     * @param object $post_type_activity The tracking arguments of the post type.
     493     * @param string $post_type Name of the post type.
     494     */
    487495    return apply_filters( 'bp_activity_get_post_type_tracking_args', $post_type_activity, $post_type );
    488496}
     
    510518    }
    511519
     520    /**
     521     * Filters tracking arguments for all post types.
     522     *
     523     * @since BuddyPress (2.2.0)
     524     *
     525     * @param array $post_types_tracking_args Array of post types with
     526     *                                        their tracking arguments.
     527     */
    512528    return apply_filters( 'bp_activity_get_post_types_tracking_args', $post_types_tracking_args );
    513529}
     
    18121828    }
    18131829
    1814     // Let components/plugins bail before the activity is posted.
     1830    /**
     1831     * Filters whether or not to post the activity.
     1832     *
     1833     * This is a variable filter, dependent on the post type,
     1834     * that lets components or plugins bail early if needed.
     1835     *
     1836     * @since BuddyPress (2.2.0)
     1837     *
     1838     * @param bool $value   Whether or not to continue.
     1839     * @param int  $blog_id ID of the current site.
     1840     * @param int  $post_id ID of the current post being published.
     1841     * @param int  $user_id ID of the current user or post author.
     1842     */
    18151843    if ( false === apply_filters( "bp_activity_{$post->post_type}_pre_publish", true, $blog_id, $post_id, $user_id ) ) {
    18161844        return;
     
    18821910    $activity_id = bp_activity_add( $activity_args );
    18831911
     1912    /**
     1913     * Fires after the publishing of an activity item for a newly published post type post.
     1914     *
     1915     * @since BuddyPress (2.2.0)
     1916     *
     1917     * @param int     $activity_id   ID of the newly published activity item.
     1918     * @param WP_Post $post          Post object.
     1919     * @param array   $activity_args Array of activity arguments.
     1920     */
    18841921    do_action( 'bp_activity_post_type_published', $activity_id, $post, $activity_args );
    18851922
     
    19471984    $updated = $activity->save();
    19481985
     1986    /**
     1987     * Fires after the updating of an activity item for a custom post type entry.
     1988     *
     1989     * @since BuddyPress (2.2.0)
     1990     *
     1991     * @param WP_Post              $post Post object.
     1992     * @param BP_Activity_Activity $activity Activity object.
     1993     */
    19491994    do_action( 'bp_activity_post_type_updated', $post, $activity );
    19501995
     
    19892034    $deleted = bp_activity_delete_by_item_id( $delete_activity_args );
    19902035
     2036    /**
     2037     * Fires after the unpublishing for the custom post type.
     2038     *
     2039     * @since BuddyPress (2.2.0)
     2040     *
     2041     * @param array   $delete_activity_args Array of arguments for activity deletion.
     2042     * @param WP_Post $post                 Post object.
     2043     * @param bool    $activity             Whether or not the activity
     2044     *                                      was successfully deleted.
     2045     */
    19912046    do_action( 'bp_activity_post_type_unpublished', $delete_activity_args, $post, $deleted );
    19922047
Note: See TracChangeset for help on using the changeset viewer.