Changeset 9218
- Timestamp:
- 12/09/2014 12:54:33 AM (10 years ago)
- Location:
- trunk/src/bp-blogs
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-blogs/bp-blogs-activity.php
r9194 r9218 52 52 } 53 53 54 /** 55 * Fires after the registry of the default blog component activity actions. 56 * 57 * @since BuddyPress (1.1.0) 58 */ 54 59 do_action( 'bp_blogs_register_activity_actions' ); 55 60 } … … 82 87 } 83 88 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 */ 84 97 return apply_filters( 'bp_blogs_format_activity_action_new_blog', $action, $activity ); 85 98 } … … 151 164 } 152 165 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 */ 153 174 return apply_filters( 'bp_blogs_format_activity_action_new_blog_post', $action, $activity ); 154 175 } … … 218 239 } 219 240 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 */ 220 249 return apply_filters( 'bp_blogs_format_activity_action_new_blog_comment', $action, $activity ); 221 250 } … … 299 328 300 329 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 */ 301 338 $r['action'] = apply_filters( 'bp_blogs_record_activity_action', $r['action'] ); 302 339 } 303 340 304 341 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 */ 305 352 $r['content'] = apply_filters( 'bp_blogs_record_activity_content', bp_create_excerpt( $r['content'] ), $r['content'], $r ); 306 353 } … … 532 579 add_action( 'comment_post', 'bp_blogs_record_comment', 10, 2 ); 533 580 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 */ 534 591 do_action( 'bp_blogs_sync_add_from_activity_comment', $comment_id, $args, $parent_activity, $user ); 535 592 } -
trunk/src/bp-blogs/bp-blogs-classes.php
r8541 r9218 59 59 $this->blog_id = apply_filters( 'bp_blogs_blog_id_before_save', $this->blog_id, $this->id ); 60 60 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 */ 61 70 do_action_ref_array( 'bp_blogs_blog_before_save', array( &$this ) ); 62 71 … … 80 89 return false; 81 90 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 */ 82 100 do_action_ref_array( 'bp_blogs_blog_after_save', array( &$this ) ); 83 101 -
trunk/src/bp-blogs/bp-blogs-filters.php
r9194 r9218 34 34 */ 35 35 function 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 */ 36 44 return apply_filters( 'bp_blogs_creation_location', trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() . '/create', $url ) ); 37 45 } … … 86 94 } 87 95 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 */ 88 103 if ( (int) $blog_id == $tags_blog_id && apply_filters( 'bp_blogs_block_sitewide_tags_activity', true ) ) { 89 104 return false; 90 105 } 91 106 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 */ 92 114 $is_blog_public = apply_filters( 'bp_is_blog_public', (int) get_blog_option( $blog_id, 'blog_public' ) ); 93 115 -
trunk/src/bp-blogs/bp-blogs-functions.php
r9194 r9218 284 284 } 285 285 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 */ 286 295 do_action_ref_array( 'bp_blogs_new_blog', array( &$recorded_blog, $is_private, $is_recorded ) ); 287 296 } … … 428 437 bp_blogs_update_blogmeta( $args['item_id'], 'last_activity', bp_core_current_time() ); 429 438 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 */ 430 448 do_action( 'bp_blogs_new_blog_post', $post->ID, $post, $args['user_id'] ); 431 449 } … … 791 809 * first. See http://buddypress.trac.wordpress.org/ticket/3916. 792 810 * 793 * @since BuddyPress (1.6 )811 * @since BuddyPress (1.6.0) 794 812 * @access private 795 813 */ … … 812 830 813 831 $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 */ 814 841 do_action( 'bp_blogs_before_remove_blog', $blog_id ); 815 842 … … 819 846 bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component' => $bp->blogs->id, 'type' => 'new_blog' ) ); 820 847 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 */ 821 856 do_action( 'bp_blogs_remove_blog', $blog_id ); 822 857 } … … 835 870 $user_id = (int) $user_id; 836 871 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 */ 837 880 do_action( 'bp_blogs_before_remove_blog_for_user', $blog_id, $user_id ); 838 881 … … 846 889 ) ); 847 890 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 */ 848 899 do_action( 'bp_blogs_remove_blog_for_user', $blog_id, $user_id ); 849 900 } … … 872 923 $user_id = bp_loggedin_user_id(); 873 924 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 */ 874 934 do_action( 'bp_blogs_before_remove_post', $blog_id, $post_id, $user_id ); 875 935 … … 877 937 bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'secondary_item_id' => $post_id, 'component' => $bp->blogs->id, 'type' => 'new_blog_post' ) ); 878 938 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 */ 879 948 do_action( 'bp_blogs_remove_post', $blog_id, $post_id, $user_id ); 880 949 } … … 936 1005 } 937 1006 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 */ 938 1016 do_action( 'bp_blogs_remove_comment', $wpdb->blogid, $comment_id, bp_loggedin_user_id() ); 939 1017 } … … 1111 1189 global $bp; 1112 1190 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 */ 1113 1199 do_action( 'bp_blogs_before_remove_data_for_blog', $blog_id ); 1114 1200 … … 1119 1205 bp_blogs_delete_activity( array( 'item_id' => $blog_id, 'component' => $bp->blogs->id, 'type' => false ) ); 1120 1206 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 */ 1121 1215 do_action( 'bp_blogs_remove_data_for_blog', $blog_id ); 1122 1216 } … … 1303 1397 return false; 1304 1398 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 */ 1305 1406 do_action( 'bp_blogs_before_remove_data', $user_id ); 1306 1407 … … 1308 1409 BP_Blogs_Blog::delete_blogs_for_user( $user_id ); 1309 1410 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 */ 1310 1418 do_action( 'bp_blogs_remove_data', $user_id ); 1311 1419 } -
trunk/src/bp-blogs/bp-blogs-loader.php
r9194 r9218 83 83 */ 84 84 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 */ 86 93 $post_types = apply_filters( 'bp_blogs_record_post_post_types', array( 'post' ) ); 87 94 -
trunk/src/bp-blogs/bp-blogs-screens.php
r9157 r9218 18 18 return false; 19 19 20 /** 21 * Fires right before the loading of the My Blogs screen template file. 22 * 23 * @since BuddyPress (1.0.0) 24 */ 20 25 do_action( 'bp_blogs_screen_my_blogs' ); 21 26 … … 34 39 return false; 35 40 41 /** 42 * Fires right before the loading of the Create A Blog screen template file. 43 * 44 * @since BuddyPress (1.0.0) 45 */ 36 46 do_action( 'bp_blogs_screen_create_a_blog' ); 37 47 … … 47 57 bp_update_is_directory( true, 'blogs' ); 48 58 59 /** 60 * Fires right before the loading of the top-level Blogs screen template file. 61 * 62 * @since BuddyPress (1.0.0) 63 */ 49 64 do_action( 'bp_blogs_screen_index' ); 50 65 … … 94 109 bp_update_is_directory( true, 'blogs' ); 95 110 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 */ 96 117 do_action( 'bp_blogs_screen_index' ); 97 118 … … 123 144 */ 124 145 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 */ 126 154 $new_templates = apply_filters( 'bp_template_hierarchy_blogs_create', array( 127 155 'blogs/index-directory.php' … … 179 207 */ 180 208 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 */ 182 217 $new_templates = apply_filters( 'bp_template_hierarchy_blogs_create', array( 183 218 'blogs/index-create.php' -
trunk/src/bp-blogs/bp-blogs-template.php
r8999 r9218 29 29 */ 30 30 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 */ 31 39 return apply_filters( 'bp_get_blogs_slug', buddypress()->blogs->slug ); 32 40 } … … 50 58 */ 51 59 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 */ 52 68 return apply_filters( 'bp_get_blogs_root_slug', buddypress()->blogs->root_slug ); 53 69 } … … 75 91 */ 76 92 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 */ 77 101 return apply_filters( 'bp_get_blogs_directory_permalink', trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() ) ); 78 102 } … … 278 302 return true; 279 303 } 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 */ 280 310 do_action( 'blog_loop_end' ); 281 311 // Do some cleaning up after the loop … … 303 333 // loop has just started 304 334 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 */ 305 341 do_action( 'blog_loop_start' ); 306 342 } … … 384 420 $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'] ); 385 421 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 */ 387 431 return apply_filters( 'bp_has_blogs', $blogs_template->has_blogs(), $blogs_template, $r ); 388 432 } … … 446 490 global $blogs_template; 447 491 492 /** 493 * Filters the blogs pagination links. 494 * 495 * @since BuddyPress (1.0.0) 496 * 497 * @param string $pag_links HTML pagination links. 498 */ 448 499 return apply_filters( 'bp_get_blogs_pagination_links', $blogs_template->pag_links ); 449 500 } … … 527 578 $avatar = apply_filters( 'bp_get_blog_avatar_' . $blogs_template->blog->blog_id, $avatar ); 528 579 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 */ 529 590 return apply_filters( 'bp_get_blog_avatar', $avatar, $blogs_template->blog->blog_id, $r ); 530 591 } … … 546 607 } 547 608 609 /** 610 * Filters the blog permalink. 611 * 612 * @since BuddyPress (1.0.0) 613 * 614 * @param string $permalink Permalink URL for the blog. 615 */ 548 616 return apply_filters( 'bp_get_blog_permalink', $permalink ); 549 617 } … … 563 631 global $blogs_template; 564 632 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 */ 565 640 return apply_filters( 'bp_get_blog_name', $blogs_template->blog->name ); 566 641 } … … 584 659 global $blogs_template; 585 660 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 */ 586 668 return apply_filters( 'bp_get_blog_id', $blogs_template->blog->blog_id ); 587 669 } … … 591 673 */ 592 674 function 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 */ 593 683 echo apply_filters( 'bp_blog_description', bp_get_blog_description() ); 594 684 } … … 601 691 global $blogs_template; 602 692 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 */ 603 700 return apply_filters( 'bp_get_blog_description', $blogs_template->blog->description ); 604 701 } … … 633 730 $classes[] = 'bp-single-blog'; 634 731 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 */ 635 739 $classes = apply_filters( 'bp_get_blog_class', $classes ); 636 740 $classes = array_merge( $classes, array() ); … … 684 788 } 685 789 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 */ 686 798 return apply_filters( 'bp_blog_last_active', $last_activity, $r ); 687 799 } … … 717 829 if ( ! empty( $retval ) ) { 718 830 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 */ 719 839 $retval = sprintf( __( 'Latest Post: %s', 'buddypress' ), '<a href="' . $blogs_template->blog->latest_post->guid . '">' . apply_filters( 'the_title', $retval ) . '</a>' ); 720 840 } else { 841 842 /** This filter is documented in bp-blogs/bp-blogs-template.php */ 721 843 $retval = '<a href="' . $blogs_template->blog->latest_post->guid . '">' . apply_filters( 'the_title', $retval ) . '</a>'; 722 844 } 723 845 } 724 846 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 */ 725 854 return apply_filters( 'bp_get_blog_latest_post', $retval ); 726 855 } … … 753 882 $retval = $blogs_template->blog->latest_post->post_title; 754 883 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 */ 755 891 return apply_filters( 'bp_get_blog_latest_post_title', $retval ); 756 892 } … … 783 919 $retval = add_query_arg( 'p', $blogs_template->blog->latest_post->ID, bp_get_blog_permalink() ); 784 920 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 */ 785 928 return apply_filters( 'bp_get_blog_latest_post_permalink', $retval ); 786 929 } … … 813 956 $retval = $blogs_template->blog->latest_post->post_content; 814 957 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 */ 815 965 return apply_filters( 'bp_get_blog_latest_post_content', $retval ); 816 966 } … … 847 997 $retval = $blogs_template->blog->latest_post->images[$size]; 848 998 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 */ 849 1006 return apply_filters( 'bp_get_blog_latest_post_featured_image', $retval ); 850 1007 } … … 863 1020 $image = bp_get_blog_latest_post_featured_image( $thumbnail ); 864 1021 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 */ 865 1031 return apply_filters( 'bp_blog_latest_post_has_featured_image', ! empty( $image ), $thumbnail, $image ); 866 1032 } … … 896 1062 */ 897 1063 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 */ 898 1072 return apply_filters( 'bp_get_total_blog_count', bp_blogs_total_blogs() ); 899 1073 } … … 915 1089 */ 916 1090 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 */ 917 1099 return apply_filters( 'bp_get_total_blog_count_for_user', bp_blogs_total_blogs_for_user( $user_id ) ); 918 1100 } … … 935 1117 $active_signup = isset( $bp->site_options['registration'] ) ? $bp->site_options['registration'] : 'all'; 936 1118 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 */ 937 1126 $active_signup = apply_filters( 'wpmu_active_signup', $active_signup ); // return "all", "none", "blog" or "user" 938 1127 … … 961 1150 } 962 1151 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 */ 964 1163 $filtered_results = apply_filters('signup_another_blog_init', array('blogname' => $blogname, 'blog_title' => $blog_title, 'errors' => $errors )); 965 1164 $blogname = $filtered_results['blogname']; … … 978 1177 979 1178 <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' ); ?> 981 1187 982 1188 <?php bp_blogs_signup_blog($blogname, $blog_title, $errors); ?> … … 1059 1265 1060 1266 <?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 */ 1061 1275 do_action('signup_blogform', $errors); 1062 1276 } … … 1092 1306 1093 1307 $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 */ 1094 1319 $meta = apply_filters( 'add_signup_meta', $meta ); 1095 1320 … … 1138 1363 1139 1364 <?php 1365 1366 /** 1367 * Fires after the default successful blog registration messsage markup. 1368 * 1369 * @since BuddyPress (1.0.0) 1370 */ 1140 1371 do_action('signup_finished'); 1141 1372 } … … 1146 1377 function bp_create_blog_link() { 1147 1378 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 */ 1148 1387 echo apply_filters( 'bp_create_blog_link', '<a href="' . bp_get_root_domain() . '/' . bp_get_blogs_root_slug() . '/create/">' . __( 'Create a Site', 'buddypress' ) . '</a>' ); 1149 1388 } … … 1169 1408 1170 1409 <?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 */ 1171 1416 do_action( 'bp_blogs_blog_tabs' ); 1172 1417 } … … 1184 1429 </form>'; 1185 1430 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 */ 1186 1438 echo apply_filters( 'bp_directory_blogs_search_form', $search_form_html ); 1187 1439 } … … 1221 1473 ); 1222 1474 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 */ 1223 1482 return bp_get_button( apply_filters( 'bp_get_blog_create_button', $button_args ) ); 1224 1483 } … … 1270 1529 $button = wp_parse_args( $args, $defaults ); 1271 1530 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 */ 1273 1538 return bp_get_button( apply_filters( 'bp_get_blogs_visit_blog_button', $button ) ); 1274 1539 } … … 1324 1589 } 1325 1590 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 */ 1327 1599 return apply_filters( 'bp_blogs_get_profile_stats', $r['output'], $r ); 1328 1600 }
Note: See TracChangeset
for help on using the changeset viewer.