Changeset 9218 for trunk/src/bp-blogs/bp-blogs-template.php
- Timestamp:
- 12/09/2014 12:54:33 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.