Skip to:
Content

BuddyPress.org

Ticket #7143: 7143-missed-hooks.diff

File 7143-missed-hooks.diff, 6.0 KB (added by tw2113, 10 years ago)
  • src/bp-blogs/bp-blogs-activity.php

    diff --git src/bp-blogs/bp-blogs-activity.php src/bp-blogs/bp-blogs-activity.php
    index 5c91e83..a6ec5b3 100644
    function bp_blogs_record_activity_on_site_creation( $recorded_blog, $is_private, 
    624624        if ( ! $is_private && ! $no_activity && bp_blogs_is_blog_trackable( $recorded_blog->blog_id, $recorded_blog->user_id ) ) {
    625625                bp_blogs_record_activity( array(
    626626                        'user_id'      => $recorded_blog->user_id,
     627
     628                        /**
     629                         * Filters the activity created blog primary link.
     630                         *
     631                         * @since 1.1.0
     632                         *
     633                         * @param string $value Blog primary link.
     634                         * @param int    $value Blog ID.
     635                         */
    627636                        'primary_link' => apply_filters( 'bp_blogs_activity_created_blog_primary_link', bp_blogs_get_blogmeta( $recorded_blog->blog_id, 'url' ), $recorded_blog->blog_id ),
    628637                        'type'         => 'new_blog',
    629638                        'item_id'      => $recorded_blog->blog_id
  • src/bp-blogs/bp-blogs-functions.php

    diff --git src/bp-blogs/bp-blogs-functions.php src/bp-blogs/bp-blogs-functions.php
    index be32eef..83f465a 100644
    function bp_blogs_get_blogs( $args = '' ) { 
    6565                $r['include_blog_ids']
    6666        );
    6767
    68         // Filter and return.
     68        /**
     69         * Filters a set of blogs.
     70         *
     71         * @since 1.2.0
     72         *
     73         * @param array $blogs Array of blog data.
     74         * @param array $r     Parsed query arguments.
     75         */
    6976        return apply_filters( 'bp_blogs_get_blogs', $blogs, $r );
    7077}
    7178
    function bp_blogs_record_existing_blogs( $args = array() ) { 
    246253 */
    247254function bp_blogs_is_blog_recordable( $blog_id, $user_id = 0 ) {
    248255
     256        /**
     257         * Filters whether or not a blog is globally activity stream recordable.
     258         *
     259         * @since 1.7.0
     260         *
     261         * @param bool $value   Whether or not recordable. Default true.
     262         * @param int  $blog_id Current blog ID.
     263         */
    249264        $recordable_globally = apply_filters( 'bp_blogs_is_blog_recordable', true, $blog_id );
    250265
    251266        if ( !empty( $user_id ) ) {
     267                /**
     268                 * Filters whether or not a blog is globally activity stream recordable for user.
     269                 *
     270                 * @since 1.7.0
     271                 *
     272                 * @param bool $recordable_globally Whether or not recordable.
     273                 * @param int  $blog_id             Current blog ID.
     274                 * @param int  $user_id             Current user ID.
     275                 */
    252276                $recordable_for_user = apply_filters( 'bp_blogs_is_blog_recordable_for_user', $recordable_globally, $blog_id, $user_id );
    253277        } else {
    254278                $recordable_for_user = $recordable_globally;
    function bp_blogs_is_blog_recordable( $blog_id, $user_id = 0 ) { 
    275299 */
    276300function bp_blogs_is_blog_trackable( $blog_id, $user_id = 0 ) {
    277301
     302        /**
     303         * Filters whether or not a blog is globally trackable.
     304         *
     305         * @since 1.7.0
     306         *
     307         * @param bool $value Whether or not trackable.
     308         * @param int  $blog_id Current blog ID.
     309         */
    278310        $trackable_globally = apply_filters( 'bp_blogs_is_blog_trackable', bp_blogs_is_blog_recordable( $blog_id, $user_id ), $blog_id );
    279311
    280312        if ( !empty( $user_id ) ) {
     313
     314                /**
     315                 * Filters whether or not a blog is globally trackable for user.
     316                 *
     317                 * @since 1.7.0
     318                 *
     319                 * @param bool $value   Whether or not trackable.
     320                 * @param int  $blog_id Current blog ID.
     321                 * @param int  $user_id Current user ID.
     322                 */
    281323                $trackable_for_user = apply_filters( 'bp_blogs_is_blog_trackable_for_user', $trackable_globally, $blog_id, $user_id );
    282324        } else {
    283325                $trackable_for_user = $trackable_globally;
    function bp_blogs_record_blog( $blog_id, $user_id, $no_activity = false ) { 
    344386        bp_blogs_update_blogmeta( $recorded_blog->blog_id, 'thread_comments_depth', $thread_depth );
    345387
    346388        $is_private = !empty( $_POST['blog_public'] ) && (int) $_POST['blog_public'] ? false : true;
     389
     390        /**
     391         * Filters whether or not a new blog is public.
     392         *
     393         * @since 1.5.0
     394         *
     395         * @param bool $is_private Whether or not blog is public.
     396         */
    347397        $is_private = !apply_filters( 'bp_is_new_blog_public', !$is_private );
    348398
    349399        /**
    add_action( 'user_register', 'bp_blogs_add_user_to_blog' ); 
    844894 * @return string
    845895 */
    846896function bp_blogs_get_allowed_roles() {
     897
     898        /**
     899         * Filters the allowed roles a member must have to be recorded into bp_user_blogs pointer table.
     900         *
     901         * @since 2.1.0
     902         *
     903         * @param array $value Array of potential roles user needs.
     904         */
    847905        return apply_filters( 'bp_blogs_get_allowed_roles', array( 'contributor', 'author', 'editor', 'administrator' ) );
    848906}
    849907
  • src/bp-blogs/bp-blogs-template.php

    diff --git src/bp-blogs/bp-blogs-template.php src/bp-blogs/bp-blogs-template.php
    index c7e1380..b591dd0 100644
    function bp_blog_last_active( $args = array() ) { 
    645645                /**
    646646                 * Filters the last active date of the current blog in the loop.
    647647                 *
    648                  * @since
     648                 * @since 1.2.0
    649649                 *
    650650                 * @param string $last_activity Last active date.
    651651                 * @param array  $r             Array of parsed args used to determine formatting.
    function bp_blog_create_nav_item() { 
    14021402
    14031403                $output = '<li id="blog-create-nav">' . $create_blog_button . '</li>';
    14041404
     1405                /**
     1406                 * Filters the Create A Site nav item output.
     1407                 *
     1408                 * @since 2.2.0
     1409                 *
     1410                 * @param string $output Nav item output.
     1411                 */
    14051412                return apply_filters( 'bp_get_blog_create_nav_item', $output );
    14061413        }
    14071414
  • src/bp-blogs/classes/class-bp-blogs-blog.php

    diff --git src/bp-blogs/classes/class-bp-blogs-blog.php src/bp-blogs/classes/class-bp-blogs-blog.php
    index f2b07cc..1e5e039 100644
    class BP_Blogs_Blog { 
    7575        public function save() {
    7676                global $wpdb;
    7777
     78                /**
     79                 * Filters the blog user ID before save.
     80                 *
     81                 * @since 1.0.0
     82                 *
     83                 * @param int $value User ID.
     84                 * @param int $value Site ID.
     85                 */
    7886                $this->user_id = apply_filters( 'bp_blogs_blog_user_id_before_save', $this->user_id, $this->id );
     87
     88                /**
     89                 * Filters the blog blog ID before save.
     90                 *
     91                 * @since 1.0.0
     92                 *
     93                 * @param int $value Blog ID.
     94                 * @param int $value Site ID.
     95                 */
    7996                $this->blog_id = apply_filters( 'bp_blogs_blog_id_before_save', $this->blog_id, $this->id );
    8097
    8198                /**