Skip to:
Content

BuddyPress.org

Changeset 9218


Ignore:
Timestamp:
12/09/2014 12:54:33 AM (9 years ago)
Author:
tw2113
Message:

Add hook documentation for the Blogs component

Fixes #5939

Location:
trunk/src/bp-blogs
Files:
7 edited

Legend:

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

    r9194 r9218  
    5252    }
    5353
     54    /**
     55     * Fires after the registry of the default blog component activity actions.
     56     *
     57     * @since BuddyPress (1.1.0)
     58     */
    5459    do_action( 'bp_blogs_register_activity_actions' );
    5560}
     
    8287    }
    8388
     89    /**
     90     * Filters the new blog activity action for the new blog.
     91     *
     92     * @since BuddyPress (2.0.0)
     93     *
     94     * @param string $action   Constructed activity action.
     95     * @param obj    $activity Activity data object.
     96     */
    8497    return apply_filters( 'bp_blogs_format_activity_action_new_blog', $action, $activity );
    8598}
     
    151164    }
    152165
     166    /**
     167     * Filters the new blog post action for the new blog.
     168     *
     169     * @since BuddyPress (2.0.0)
     170     *
     171     * @param string $action   Constructed activity action.
     172     * @param obj    $activity Activity data object.
     173     */
    153174    return apply_filters( 'bp_blogs_format_activity_action_new_blog_post', $action, $activity );
    154175}
     
    218239    }
    219240
     241    /**
     242     * Filters the new blog comment action for the new blog.
     243     *
     244     * @since BuddyPress (2.0.0)
     245     *
     246     * @param string $action   Constructed activity action.
     247     * @param obj    $activity Activity data object.
     248     */
    220249    return apply_filters( 'bp_blogs_format_activity_action_new_blog_comment', $action, $activity );
    221250}
     
    299328
    300329    if ( ! empty( $r['action'] ) ) {
     330
     331        /**
     332         * Filters the action associated with activity for activity stream.
     333         *
     334         * @since BuddyPress (1.2.0)
     335         *
     336         * @param string $value Action for the activity stream.
     337         */
    301338        $r['action'] = apply_filters( 'bp_blogs_record_activity_action', $r['action'] );
    302339    }
    303340
    304341    if ( ! empty( $r['content'] ) ) {
     342
     343        /**
     344         * Filters the content associated with activity for activity stream.
     345         *
     346         * @since BuddyPress (1.2.0)
     347         *
     348         * @param string $value Generated excerpt from content for the activity stream.
     349         * @param string $value Content for the activity stream.
     350         * @param array  $r     Array of arguments used for the activity stream item.
     351         */
    305352        $r['content'] = apply_filters( 'bp_blogs_record_activity_content', bp_create_excerpt( $r['content'] ), $r['content'], $r );
    306353    }
     
    532579    add_action( 'comment_post', 'bp_blogs_record_comment', 10, 2 );
    533580
     581    /**
     582     * Fires after activity comments have been synced and posted as blog comments.
     583     *
     584     * @since BuddyPress (2.0.0)
     585     *
     586     * @param int    $comment_id      The activity ID for the posted activity comment.
     587     * @param array  $args            Array of args used for the comment syncing.
     588     * @param object $parent_activity Parameters of the blog post parent activity item.
     589     * @param object $user            User data object for the blog comment.
     590     */
    534591    do_action( 'bp_blogs_sync_add_from_activity_comment', $comment_id, $args, $parent_activity, $user );
    535592}
  • trunk/src/bp-blogs/bp-blogs-classes.php

    r8541 r9218  
    5959        $this->blog_id = apply_filters( 'bp_blogs_blog_id_before_save', $this->blog_id, $this->id );
    6060
     61        /**
     62         * Fires before the current blog item gets saved.
     63         *
     64         * Please use this hook to filter the properties above. Each part will be passed in.
     65         *
     66         * @since BuddyPress (1.0.0)
     67         *
     68         * @param BP_Blogs_Blog Current instance of the blog item being saved. Passed by reference.
     69         */
    6170        do_action_ref_array( 'bp_blogs_blog_before_save', array( &$this ) );
    6271
     
    8089            return false;
    8190
     91        /**
     92         * Fires after the current blog item gets saved.
     93         *
     94         * Please use this hook to filter the properties above. Each part will be passed in.
     95         *
     96         * @since BuddyPress (1.0.0)
     97         *
     98         * @param BP_Blogs_Blog Current instance of the blog item being saved. Passed by reference.
     99         */
    82100        do_action_ref_array( 'bp_blogs_blog_after_save', array( &$this ) );
    83101
  • trunk/src/bp-blogs/bp-blogs-filters.php

    r9194 r9218  
    3434 */
    3535function bp_blogs_creation_location( $url ) {
     36
     37    /**
     38     * Filters the 'Create a new site' link URL.
     39     *
     40     * @since BuddyPress (1.6.0)
     41     *
     42     * @param string $value URL for the 'Create a new site' signup page.
     43     */
    3644    return apply_filters( 'bp_blogs_creation_location', trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() . '/create', $url ) );
    3745}
     
    8694    }
    8795
     96    /**
     97     * Filters whether or not BuddyPress should block sitewide tags activity.
     98     *
     99     * @since BuddyPress (2.2.0)
     100     *
     101     * @param bool $value Current status of the sitewide tags activity.
     102     */
    88103    if ( (int) $blog_id == $tags_blog_id && apply_filters( 'bp_blogs_block_sitewide_tags_activity', true ) ) {
    89104        return false;
    90105    }
    91106
     107    /**
     108     * Filters whether or not the current blog is public.
     109     *
     110     * @since BuddyPress (2.2.0)
     111     *
     112     * @param int $value Value from the blog_public option for the current blog.
     113     */
    92114    $is_blog_public = apply_filters( 'bp_is_blog_public', (int) get_blog_option( $blog_id, 'blog_public' ) );
    93115
  • trunk/src/bp-blogs/bp-blogs-functions.php

    r9194 r9218  
    284284    }
    285285
     286    /**
     287     * Fires after BuddyPress has been made aware of a new site for activity tracking.
     288     *
     289     * @since BuddyPress (1.0.0)
     290     *
     291     * @param BP_Blogs_Blog $recorded_blog Current blog being recorded. Passed by reference.
     292     * @param bool          $is_private    Whether or not the current blog being recorded is private.
     293     * @param bool          $is_recorded   Whether or not the current blog was recorded.
     294     */
    286295    do_action_ref_array( 'bp_blogs_new_blog', array( &$recorded_blog, $is_private, $is_recorded ) );
    287296}
     
    428437    bp_blogs_update_blogmeta( $args['item_id'], 'last_activity', bp_core_current_time() );
    429438
     439    /**
     440     * Fires after BuddyPress has recorded metadata about a published blog post.
     441     *
     442     * @since BuddyPress (1.0.0)
     443     *
     444     * @param int     $ID    ID of the blog post being recorded.
     445     * @param WP_Post $post  WP_Post object for the current blog post.
     446     * @param string  $value ID of the user associated with the current blog post.
     447     */
    430448    do_action( 'bp_blogs_new_blog_post', $post->ID, $post, $args['user_id'] );
    431449}
     
    791809 * first. See http://buddypress.trac.wordpress.org/ticket/3916.
    792810 *
    793  * @since BuddyPress (1.6)
     811 * @since BuddyPress (1.6.0)
    794812 * @access private
    795813 */
     
    812830
    813831    $blog_id = (int) $blog_id;
     832
     833    /**
     834     * Fires before a "blog created" item is removed from blogs
     835     * tracker and activity stream.
     836     *
     837     * @since BuddyPress (1.5.0)
     838     *
     839     * @param int $blog_id ID of the blog having its item removed.
     840     */
    814841    do_action( 'bp_blogs_before_remove_blog', $blog_id );
    815842
     
    819846    bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component' => $bp->blogs->id, 'type' => 'new_blog' ) );
    820847
     848    /**
     849     * Fires after a "blog created" item has been removed from blogs
     850     * tracker and activity stream.
     851     *
     852     * @since BuddyPress (1.0.0)
     853     *
     854     * @param int $blog_id ID of the blog who had its item removed.
     855     */
    821856    do_action( 'bp_blogs_remove_blog', $blog_id );
    822857}
     
    835870    $user_id = (int) $user_id;
    836871
     872    /**
     873     * Fires before a blog is removed from the tracker for a specific user.
     874     *
     875     * @since BuddyPress (1.5.0)
     876     *
     877     * @param int $blog_id ID of the blog being removed.
     878     * @param int $user_id ID of the user having the blog removed for.
     879     */
    837880    do_action( 'bp_blogs_before_remove_blog_for_user', $blog_id, $user_id );
    838881
     
    846889    ) );
    847890
     891    /**
     892     * Fires after a blog has been removed from the tracker for a specific user.
     893     *
     894     * @since BuddyPress (1.0.0)
     895     *
     896     * @param int $blog_id ID of the blog that was removed.
     897     * @param int $user_id ID of the user having the blog removed for.
     898     */
    848899    do_action( 'bp_blogs_remove_blog_for_user', $blog_id, $user_id );
    849900}
     
    872923        $user_id = bp_loggedin_user_id();
    873924
     925    /**
     926     * Fires before removal of a blog post activity item from the activity stream.
     927     *
     928     * @since BuddyPress (1.5.0)
     929     *
     930     * @param int $blog_id ID of the blog associated with the post that was removed.
     931     * @param int $post_id ID of the post that was removed.
     932     * @param int $user_id ID of the user having the blog removed for.
     933     */
    874934    do_action( 'bp_blogs_before_remove_post', $blog_id, $post_id, $user_id );
    875935
     
    877937    bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'secondary_item_id' => $post_id, 'component' => $bp->blogs->id, 'type' => 'new_blog_post' ) );
    878938
     939    /**
     940     * Fires after removal of a blog post activity item from the activity stream.
     941     *
     942     * @since BuddyPress (1.0.0)
     943     *
     944     * @param int $blog_id ID of the blog associated with the post that was removed.
     945     * @param int $post_id ID of the post that was removed.
     946     * @param int $user_id ID of the user having the blog removed for.
     947     */
    879948    do_action( 'bp_blogs_remove_post', $blog_id, $post_id, $user_id );
    880949}
     
    9361005    }
    9371006
     1007    /**
     1008     * Fires after a blog comment activity item was removed from activity stream.
     1009     *
     1010     * @since BuddyPress (1.0.0)
     1011     *
     1012     * @param int $blogid     Item ID for the blog associated with the removed comment.
     1013     * @param int $comment_id ID of the comment being removed.
     1014     * @param int $value      ID of the current logged in user.
     1015     */
    9381016    do_action( 'bp_blogs_remove_comment', $wpdb->blogid, $comment_id, bp_loggedin_user_id() );
    9391017}
     
    11111189    global $bp;
    11121190
     1191    /**
     1192     * Fires before all data related to a given blog is removed from blogs tracker
     1193     * and activity stream.
     1194     *
     1195     * @since BuddyPress (1.5.0)
     1196     *
     1197     * @param int $blog_id ID of the blog whose data is being removed.
     1198     */
    11131199    do_action( 'bp_blogs_before_remove_data_for_blog', $blog_id );
    11141200
     
    11191205    bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component' => $bp->blogs->id, 'type' => false ) );
    11201206
     1207    /**
     1208     * Fires after all data related to a given blog has been removed from blogs tracker
     1209     * and activity stream.
     1210     *
     1211     * @since BuddyPress (1.0.0)
     1212     *
     1213     * @param int $blog_id ID of the blog whose data is being removed.
     1214     */
    11211215    do_action( 'bp_blogs_remove_data_for_blog', $blog_id );
    11221216}
     
    13031397        return false;
    13041398
     1399    /**
     1400     * Fires before all blog associations are removed for a given user.
     1401     *
     1402     * @since BuddyPress (1.5.0)
     1403     *
     1404     * @param int $user_id ID of the user whose blog associations are being removed.
     1405     */
    13051406    do_action( 'bp_blogs_before_remove_data', $user_id );
    13061407
     
    13081409    BP_Blogs_Blog::delete_blogs_for_user( $user_id );
    13091410
     1411    /**
     1412     * Fires after all blog associations are removed for a given user.
     1413     *
     1414     * @since BuddyPress (1.0.0)
     1415     *
     1416     * @param int $user_id ID of the user whose blog associations were removed.
     1417     */
    13101418    do_action( 'bp_blogs_remove_data', $user_id );
    13111419}
  • trunk/src/bp-blogs/bp-blogs-loader.php

    r9194 r9218  
    8383         */
    8484        if ( 0 !== (int) get_option( 'blog_public' ) || ! is_multisite() ) {
    85             // Get all posts to track.
     85
     86            /**
     87             * Filters the post types to track for the Blog component.
     88             *
     89             * @since BuddyPress (1.5.0)
     90             *
     91             * @param array $value Array of post types to track.
     92             */
    8693            $post_types = apply_filters( 'bp_blogs_record_post_post_types', array( 'post' ) );
    8794
  • trunk/src/bp-blogs/bp-blogs-screens.php

    r9157 r9218  
    1818        return false;
    1919
     20    /**
     21     * Fires right before the loading of the My Blogs screen template file.
     22     *
     23     * @since BuddyPress (1.0.0)
     24     */
    2025    do_action( 'bp_blogs_screen_my_blogs' );
    2126
     
    3439        return false;
    3540
     41    /**
     42     * Fires right before the loading of the Create A Blog screen template file.
     43     *
     44     * @since BuddyPress (1.0.0)
     45     */
    3646    do_action( 'bp_blogs_screen_create_a_blog' );
    3747
     
    4757        bp_update_is_directory( true, 'blogs' );
    4858
     59        /**
     60         * Fires right before the loading of the top-level Blogs screen template file.
     61         *
     62         * @since BuddyPress (1.0.0)
     63         */
    4964        do_action( 'bp_blogs_screen_index' );
    5065
     
    94109            bp_update_is_directory( true, 'blogs' );
    95110
     111            /**
     112             * Fires if in the blog directory and BuddyPress needs Blog theme compatibility,
     113             * before the actions and filters are added.
     114             *
     115             * @since BuddyPress (1.5.0)
     116             */
    96117            do_action( 'bp_blogs_screen_index' );
    97118
     
    123144     */
    124145    public function directory_template_hierarchy( $templates ) {
    125         // Setup our templates based on priority
     146
     147        /**
     148         * Filters the custom templates used for theme compat with the blog directory page.
     149         *
     150         * @since BuddyPress (1.8.0)
     151         *
     152         * @param array $value Array of template paths to add to template list to look for.
     153         */
    126154        $new_templates = apply_filters( 'bp_template_hierarchy_blogs_create', array(
    127155            'blogs/index-directory.php'
     
    179207     */
    180208    public function create_template_hierarchy( $templates ) {
    181         // Setup our templates based on priority
     209
     210        /**
     211         * Filters the custom templates used for theme compat with the blog create page.
     212         *
     213         * @since BuddyPress (1.8.0)
     214         *
     215         * @param array $value Array of template paths to add to template list to look for.
     216         */
    182217        $new_templates = apply_filters( 'bp_template_hierarchy_blogs_create', array(
    183218            'blogs/index-create.php'
  • trunk/src/bp-blogs/bp-blogs-template.php

    r8999 r9218  
    2929     */
    3030    function bp_get_blogs_slug() {
     31
     32        /**
     33         * Filters the blogs component slug.
     34         *
     35         * @since BuddyPress (1.5.0)
     36         *
     37         * @param string $slug Slug for the blogs component.
     38         */
    3139        return apply_filters( 'bp_get_blogs_slug', buddypress()->blogs->slug );
    3240    }
     
    5058     */
    5159    function bp_get_blogs_root_slug() {
     60
     61        /**
     62         * Filters the blogs component root slug.
     63         *
     64         * @since BuddyPress (1.5.0)
     65         *
     66         * @param string $root_slug Root slug for the blogs component.
     67         */
    5268        return apply_filters( 'bp_get_blogs_root_slug', buddypress()->blogs->root_slug );
    5369    }
     
    7591     */
    7692    function bp_get_blogs_directory_permalink() {
     93
     94        /**
     95         * Filters the blog directory permalink.
     96         *
     97         * @since BuddyPress (1.5.0)
     98         *
     99         * @param string $value Permalink URL for the blog directory.
     100         */
    77101        return apply_filters( 'bp_get_blogs_directory_permalink', trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() ) );
    78102    }
     
    278302            return true;
    279303        } elseif ( ( $this->current_blog + 1 ) === $this->blog_count ) {
     304
     305            /**
     306             * Fires right before the rewinding of blogs listing after all are shown.
     307             *
     308             * @since BuddyPress (1.5.0)
     309             */
    280310            do_action( 'blog_loop_end' );
    281311            // Do some cleaning up after the loop
     
    303333        // loop has just started
    304334        if ( 0 === $this->current_blog ) {
     335
     336            /**
     337             * Fires if on the first blog in the loop.
     338             *
     339             * @since BuddyPress (1.5.0)
     340             */
    305341            do_action( 'blog_loop_start' );
    306342        }
     
    384420    $blogs_template = new BP_Blogs_Template( $r['type'], $r['page'], $r['per_page'], $r['max'], $r['user_id'], $r['search_terms'], $r['page_arg'], $r['update_meta_cache'], $r['include_blog_ids'] );
    385421
    386     // Filter and return
     422    /**
     423     * Filters whether or not there are blogs to list.
     424     *
     425     * @since BuddyPress (1.1.0)
     426     *
     427     * @param bool              $value          Whether or not there are blogs to list.
     428     * @param BP_Blogs_Template $blogs_template Current blogs template object.
     429     * @param array             $r              Parsed arguments used in blogs template query.
     430     */
    387431    return apply_filters( 'bp_has_blogs', $blogs_template->has_blogs(), $blogs_template, $r );
    388432}
     
    446490        global $blogs_template;
    447491
     492        /**
     493         * Filters the blogs pagination links.
     494         *
     495         * @since BuddyPress (1.0.0)
     496         *
     497         * @param string $pag_links HTML pagination links.
     498         */
    448499        return apply_filters( 'bp_get_blogs_pagination_links', $blogs_template->pag_links );
    449500    }
     
    527578        $avatar = apply_filters( 'bp_get_blog_avatar_' . $blogs_template->blog->blog_id, $avatar );
    528579
     580        /**
     581         * Filters a blog's avatar.
     582         *
     583         * @since BuddyPress (1.5.0)
     584         *
     585         * @param string $avatar  Formatted HTML <img> element, or raw avatar
     586         *                        URL based on $html arg.
     587         * @param int    $blog_id ID of the blog whose avatar is being displayed.
     588         * @param array  $r       Array of arguments used when fetching avatar.
     589         */
    529590        return apply_filters( 'bp_get_blog_avatar', $avatar, $blogs_template->blog->blog_id, $r );
    530591    }
     
    546607        }
    547608
     609        /**
     610         * Filters the blog permalink.
     611         *
     612         * @since BuddyPress (1.0.0)
     613         *
     614         * @param string $permalink Permalink URL for the blog.
     615         */
    548616        return apply_filters( 'bp_get_blog_permalink', $permalink );
    549617    }
     
    563631        global $blogs_template;
    564632
     633        /**
     634         * Filters the name of the current blog in the loop.
     635         *
     636         * @since BuddyPress (1.2.0)
     637         *
     638         * @param string $name Name of the current blog in the loop.
     639         */
    565640        return apply_filters( 'bp_get_blog_name', $blogs_template->blog->name );
    566641    }
     
    584659        global $blogs_template;
    585660
     661        /**
     662         * Filters the ID of the current blog in the loop.
     663         *
     664         * @since BuddyPress (1.7.0)
     665         *
     666         * @param int $blog_id ID of the current blog in the loop.
     667         */
    586668        return apply_filters( 'bp_get_blog_id', $blogs_template->blog->blog_id );
    587669    }
     
    591673 */
    592674function bp_blog_description() {
     675
     676    /**
     677     * Filters the description of the current blog in the loop.
     678     *
     679     * @since BuddyPress (1.2.0)
     680     *
     681     * @param string $value Description of the current blog in the loop.
     682     */
    593683    echo apply_filters( 'bp_blog_description', bp_get_blog_description() );
    594684}
     
    601691        global $blogs_template;
    602692
     693        /**
     694         * Filters the description of the current blog in the loop.
     695         *
     696         * @since BuddyPress (1.0.0)
     697         *
     698         * @param string $value Description of the current blog in the loop.
     699         */
    603700        return apply_filters( 'bp_get_blog_description', $blogs_template->blog->description );
    604701    }
     
    633730            $classes[] = 'bp-single-blog';
    634731
     732        /**
     733         * Filters the row class of the current blog in the loop.
     734         *
     735         * @since BuddyPress (1.7.0)
     736         *
     737         * @param array $classes Array of classes to be applied to row.
     738         */
    635739        $classes = apply_filters( 'bp_get_blog_class', $classes );
    636740        $classes = array_merge( $classes, array() );
     
    684788        }
    685789
     790        /**
     791         * Filters the last active date of the current blog in the loop.
     792         *
     793         * @since
     794         *
     795         * @param string $last_activity Last active date.
     796         * @param array  $r             Array of parsed args used to determine formatting.
     797         */
    686798        return apply_filters( 'bp_blog_last_active', $last_activity, $r );
    687799    }
     
    717829        if ( ! empty( $retval ) ) {
    718830            if ( ! empty( $r['latest_format'] ) ) {
     831
     832                /**
     833                 * Filters the title text of the latest post for the current blog in loop.
     834                 *
     835                 * @since BuddyPress (1.0.0)
     836                 *
     837                 * @param string $retval Title of the latest post.
     838                 */
    719839                $retval = sprintf( __( 'Latest Post: %s', 'buddypress' ), '<a href="' . $blogs_template->blog->latest_post->guid . '">' . apply_filters( 'the_title', $retval ) . '</a>' );
    720840            } else {
     841
     842                /** This filter is documented in bp-blogs/bp-blogs-template.php */
    721843                $retval = '<a href="' . $blogs_template->blog->latest_post->guid . '">' . apply_filters( 'the_title', $retval ) . '</a>';
    722844            }
    723845        }
    724846
     847        /**
     848         * Filters the HTML markup result for the latest blog post in loop.
     849         *
     850         * @since BuddyPress (1.2.0)
     851         *
     852         * @param string $retval HTML markup for the latest post.
     853         */
    725854        return apply_filters( 'bp_get_blog_latest_post', $retval );
    726855    }
     
    753882            $retval = $blogs_template->blog->latest_post->post_title;
    754883
     884        /**
     885         * Filters the title text of the latest post on the current blog in the loop.
     886         *
     887         * @since BuddyPress (1.7.0)
     888         *
     889         * @param string $retval Title text for the latest post.
     890         */
    755891        return apply_filters( 'bp_get_blog_latest_post_title', $retval );
    756892    }
     
    783919            $retval = add_query_arg( 'p', $blogs_template->blog->latest_post->ID, bp_get_blog_permalink() );
    784920
     921        /**
     922         * Filters the permalink of the latest post on the current blog in the loop.
     923         *
     924         * @since BuddyPress (1.7.0)
     925         *
     926         * @param string $retval Permalink URL of the latest post.
     927         */
    785928        return apply_filters( 'bp_get_blog_latest_post_permalink', $retval );
    786929    }
     
    813956            $retval = $blogs_template->blog->latest_post->post_content;
    814957
     958        /**
     959         * Filters the content of the latest post on the current blog in the loop.
     960         *
     961         * @since BuddyPress (1.7.0)
     962         *
     963         * @param string $retval Content of the latest post on the current blog in the loop.
     964         */
    815965        return apply_filters( 'bp_get_blog_latest_post_content', $retval );
    816966    }
     
    847997            $retval = $blogs_template->blog->latest_post->images[$size];
    848998
     999        /**
     1000         * Filters the featured image of the latest post on the current blog in the loop.
     1001         *
     1002         * @since BuddyPress (1.7.0)
     1003         *
     1004         * @param string $retval The featured image of the latest post on the current blog in the loop.
     1005         */
    8491006        return apply_filters( 'bp_get_blog_latest_post_featured_image', $retval );
    8501007    }
     
    8631020    $image  = bp_get_blog_latest_post_featured_image( $thumbnail );
    8641021
     1022    /**
     1023     * Filters whether or not the latest blog post has a featured image.
     1024     *
     1025     * @since BuddyPress (1.7.0)
     1026     *
     1027     * @param bool   $value     Whether or not the latest blog post has a featured image.
     1028     * @param string $thumbnail Image version to return.
     1029     * @param string $image     Returned value from bp_get_blog_latest_post_featured_image.
     1030     */
    8651031    return apply_filters( 'bp_blog_latest_post_has_featured_image', ! empty( $image ), $thumbnail, $image );
    8661032}
     
    8961062     */
    8971063    function bp_get_total_blog_count() {
     1064
     1065        /**
     1066         * Filters the total number of blogs on the site.
     1067         *
     1068         * @since BuddyPress (1.2.0)
     1069         *
     1070         * @param int $value Total number of blogs on the site.
     1071         */
    8981072        return apply_filters( 'bp_get_total_blog_count', bp_blogs_total_blogs() );
    8991073    }
     
    9151089     */
    9161090    function bp_get_total_blog_count_for_user( $user_id = 0 ) {
     1091
     1092        /**
     1093         * Filters the total number of blogs for a given user.
     1094         *
     1095         * @since BuddyPress (1.2.0)
     1096         *
     1097         * @param int $value Total number of blogs for a given user.
     1098         */
    9171099        return apply_filters( 'bp_get_total_blog_count_for_user', bp_blogs_total_blogs_for_user( $user_id ) );
    9181100    }
     
    9351117    $active_signup = isset( $bp->site_options['registration'] ) ? $bp->site_options['registration'] : 'all';
    9361118
     1119    /**
     1120     * Filters whether or not blog creation is enabled.
     1121     *
     1122     * @since BuddyPress (1.0.0)
     1123     *
     1124     * @param string $active_signup Value of the registration site option creation status.
     1125     */
    9371126    $active_signup = apply_filters( 'wpmu_active_signup', $active_signup ); // return "all", "none", "blog" or "user"
    9381127
     
    9611150        }
    9621151
    963         // allow definition of default variables
     1152        /**
     1153         * Filters the default values for Blog name, title, and any current errors.
     1154         *
     1155         * @since BuddyPress (1.0.0)
     1156         *
     1157         * @param array $value {
     1158         *      string   $blogname   Default blog name provided.
     1159         *      string   $blog_title Default blog title provided.
     1160         *      WP_Error $errors     WP_Error object.
     1161         * }
     1162         */
    9641163        $filtered_results = apply_filters('signup_another_blog_init', array('blogname' => $blogname, 'blog_title' => $blog_title, 'errors' => $errors ));
    9651164        $blogname = $filtered_results['blogname'];
     
    9781177
    9791178            <input type="hidden" name="stage" value="gimmeanotherblog" />
    980             <?php do_action( 'signup_hidden_fields' ); ?>
     1179            <?php
     1180
     1181            /**
     1182             * Fires after the default hidden fields in blog signup form markup.
     1183             *
     1184             * @since BuddyPress (1.0.0)
     1185             */
     1186            do_action( 'signup_hidden_fields' ); ?>
    9811187
    9821188            <?php bp_blogs_signup_blog($blogname, $blog_title, $errors); ?>
     
    10591265
    10601266    <?php
     1267
     1268    /**
     1269     * Fires at the end of all of the default input fields for blog creation form.
     1270     *
     1271     * @since BuddyPress (1.0.0)
     1272     *
     1273     * @param WP_Error $errors WP_Error object if any present.
     1274     */
    10611275    do_action('signup_blogform', $errors);
    10621276}
     
    10921306
    10931307    $meta = apply_filters( 'signup_create_blog_meta', array( 'lang_id' => 1, 'public' => $public ) ); // depreciated
     1308
     1309    /**
     1310     * Filters the default values for Blog meta.
     1311     *
     1312     * @since BuddyPress (1.0.0)
     1313     *
     1314     * @param array $meta {
     1315     *      string   $value   Default blog language ID.
     1316     *      string   $public  Default public status.
     1317     * }
     1318     */
    10941319    $meta = apply_filters( 'add_signup_meta', $meta );
    10951320
     
    11381363
    11391364<?php
     1365
     1366    /**
     1367     * Fires after the default successful blog registration messsage markup.
     1368     *
     1369     * @since BuddyPress (1.0.0)
     1370     */
    11401371    do_action('signup_finished');
    11411372}
     
    11461377function bp_create_blog_link() {
    11471378    if ( bp_is_my_profile() )
     1379
     1380        /**
     1381         * Filters "Create a Site" links for users viewing their own profiles.
     1382         *
     1383         * @since BuddyPress (1.0.0)
     1384         *
     1385         * @param string $value HTML link for creating a site.
     1386         */
    11481387        echo apply_filters( 'bp_create_blog_link', '<a href="' . bp_get_root_domain() . '/' . bp_get_blogs_root_slug() . '/create/">' . __( 'Create a Site', 'buddypress' ) . '</a>' );
    11491388}
     
    11691408
    11701409<?php
     1410
     1411    /**
     1412     * Fires after the markup for the navigation tabs for a user Blogs page.
     1413     *
     1414     * @since BuddyPress (1.0.0)
     1415     */
    11711416    do_action( 'bp_blogs_blog_tabs' );
    11721417}
     
    11841429    </form>';
    11851430
     1431    /**
     1432     * Filters the output for the blog directory search form.
     1433     *
     1434     * @since BuddyPress (1.9.0)
     1435     *
     1436     * @param string $search_form_html HTML markup for blog directory search form.
     1437     */
    11861438    echo apply_filters( 'bp_directory_blogs_search_form', $search_form_html );
    11871439}
     
    12211473        );
    12221474
     1475        /**
     1476         * Filters the Create a Site button.
     1477         *
     1478         * @since BuddyPress (2.0.0)
     1479         *
     1480         * @param array $button_args Array of arguments to be used for the Create a Site button.
     1481         */
    12231482        return bp_get_button( apply_filters( 'bp_get_blog_create_button', $button_args ) );
    12241483    }
     
    12701529        $button = wp_parse_args( $args, $defaults );
    12711530
    1272         // Filter and return the HTML button
     1531        /**
     1532         * Filters the button for visiting a blog in a loop.
     1533         *
     1534         * @since BuddyPress (1.2.10)
     1535         *
     1536         * @param array $button Array of arguments to be used for the button to visit a blog.
     1537         */
    12731538        return bp_get_button( apply_filters( 'bp_get_blogs_visit_blog_button', $button ) );
    12741539    }
     
    13241589    }
    13251590
    1326     // Filter and return
     1591    /**
     1592     * Filters the number of blogs in user's profile.
     1593     *
     1594     * @since BuddyPress (2.0.0)
     1595     *
     1596     * @param string $value Output determined for the profile stats.
     1597     * @param array  $r     Array of arguments used for default output if none provided.
     1598     */
    13271599    return apply_filters( 'bp_blogs_get_profile_stats', $r['output'], $r );
    13281600}
Note: See TracChangeset for help on using the changeset viewer.