Changeset 9715
- Timestamp:
- 04/07/2015 05:06:57 AM (10 years ago)
- Location:
- trunk/src/bp-core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-template.php
r9707 r9715 72 72 $list_type = bp_is_group() ? 'groups' : 'personal'; 73 73 74 // echo out the final list item 74 /** 75 * Filters the "options nav", the secondary-level single item navigation menu. 76 * 77 * This is a dynamic filter that is dependent on the provided css_id value. 78 * 79 * @since BuddyPress (1.1.0) 80 * 81 * @param string $value HTML list item for the submenu item. 82 * @param array $subnav_item Submenu array item being displayed. 83 * @param string $selected_item Current action. 84 */ 75 85 echo apply_filters( 'bp_get_options_nav_' . $subnav_item['css_id'], '<li id="' . esc_attr( $subnav_item['css_id'] . '-' . $list_type . '-li' ) . '" ' . $selected . '><a id="' . esc_attr( $subnav_item['css_id'] ) . '" href="' . esc_url( $subnav_item['link'] ) . '">' . $subnav_item['name'] . '</a></li>', $subnav_item, $selected_item ); 76 86 } … … 115 125 } 116 126 127 /** 128 * Filters the directory title for a component. 129 * 130 * @since BuddyPress (2.0.0) 131 * 132 * @param string $title Text to be used in <title> tag. 133 * @param string $component Current componet being displayed. 134 */ 117 135 return apply_filters( 'bp_get_directory_title', $title, $component ); 118 136 } … … 201 219 : 'upload-image'; 202 220 221 /** 222 * Filters the current avatar upload step. 223 * 224 * @since BuddyPress (1.1.0) 225 * 226 * @param string $step The current avatar upload step. 227 */ 203 228 return apply_filters( 'bp_get_avatar_admin_step', $step ); 204 229 } … … 221 246 : ''; 222 247 248 /** 249 * Filters the URL of the avatar to crop. 250 * 251 * @since BuddyPress (1.1.0) 252 * 253 * @param string $url URL for the avatar. 254 */ 223 255 return apply_filters( 'bp_get_avatar_to_crop', $url ); 224 256 } … … 241 273 : ''; 242 274 275 /** 276 * Filters the relative file path to the avatar to crop. 277 * 278 * @since BuddyPress (1.1.0) 279 * 280 * @param string $src Relative file path for the avatar. 281 */ 243 282 return apply_filters( 'bp_get_avatar_to_crop_src', $src ); 244 283 } … … 269 308 */ 270 309 function bp_get_site_name() { 310 311 /** 312 * Filters the name of the BP site. Used in RSS headers. 313 * 314 * @since BuddyPress (1.0.0) 315 * 316 * @param string $value Current BP site name. 317 */ 271 318 return apply_filters( 'bp_site_name', get_bloginfo( 'name', 'display' ) ); 272 319 } … … 343 390 } 344 391 392 /** 393 * Filters the date based on a UNIX timestamp. 394 * 395 * @since BuddyPress (1.0.0) 396 * 397 * @param string $formatted_date Formatted date from the timestamp. 398 */ 345 399 return apply_filters( 'bp_format_time', $formatted_date ); 346 400 } … … 372 426 if ( bp_displayed_user_id() == bp_loggedin_user_id() ) { 373 427 if ( true == $echo ) { 428 429 /** 430 * Filters the text used based on context of own profile or someone else's profile. 431 * 432 * @since BuddyPress (1.0.0) 433 * 434 * @param string $youtext Context-determined string to display. 435 */ 374 436 echo apply_filters( 'bp_word_or_name', $youtext ); 375 437 } else { 438 439 /** This filter is documented in bp-core/bp-core-template.php */ 376 440 return apply_filters( 'bp_word_or_name', $youtext ); 377 441 } … … 381 445 $nametext = sprintf( $nametext, $fullname[0] ); 382 446 if ( true == $echo ) { 447 448 /** This filter is documented in bp-core/bp-core-template.php */ 383 449 echo apply_filters( 'bp_word_or_name', $nametext ); 384 450 } else { 451 452 /** This filter is documented in bp-core/bp-core-template.php */ 385 453 return apply_filters( 'bp_word_or_name', $nametext ); 386 454 } … … 408 476 */ 409 477 function bp_search_form_action() { 478 479 /** 480 * Filters the "action" attribute for search forms. 481 * 482 * @since BuddyPress (1.0.0) 483 * 484 * @param string $value Search form action url. 485 */ 410 486 return apply_filters( 'bp_search_form_action', trailingslashit( bp_get_root_domain() . '/' . bp_get_search_slug() ) ); 411 487 } … … 444 520 $selection_box .= '<select name="search-which" id="search-which" style="width: auto">'; 445 521 522 /** 523 * Filters all of the component options available for search scope. 524 * 525 * @since BuddyPress (1.5.0) 526 * 527 * @param array $options Array of options to add to select field. 528 */ 446 529 $options = apply_filters( 'bp_search_form_type_select_options', $options ); 447 530 foreach( (array) $options as $option_value => $option_title ) { … … 451 534 $selection_box .= '</select>'; 452 535 536 /** 537 * Filters the complete <select> input used for search scope. 538 * 539 * @since BuddyPress (1.0.0) 540 * 541 * @param string $selection_box <select> input for selecting search scope. 542 */ 453 543 return apply_filters( 'bp_search_form_type_select', $selection_box ); 454 544 } … … 500 590 } 501 591 592 /** 593 * Filters the default text for the search box for a given component. 594 * 595 * @since BuddyPress (1.5.0) 596 * 597 * @param string $default_text Default text for search box. 598 * @param string $component Current component displayed. 599 */ 502 600 return apply_filters( 'bp_get_search_default_text', $default_text, $component ); 503 601 } … … 619 717 function bp_get_button( $args = '' ) { 620 718 $button = new BP_Button( $args ); 719 720 /** 721 * Filters the requested button output. 722 * 723 * @since BuddyPress (1.2.6) 724 * 725 * @param string $contents Button context to be used. 726 * @param array $args Array of args for the button. 727 * @param BP_Button $button BP_Button object. 728 */ 621 729 return apply_filters( 'bp_get_button', $button->contents, $args, $button ); 622 730 } … … 669 777 $original_text = $text; 670 778 671 // Allow plugins to modify these values globally 779 /** 780 * Filters the excerpt length to trim text to. 781 * 782 * @since BuddyPress (1.5.0) 783 * 784 * @param int $length Length of returned string, including ellipsis. 785 */ 672 786 $length = apply_filters( 'bp_excerpt_length', $length ); 787 788 /** 789 * Filters the excerpt appended text value. 790 * 791 * @since BuddyPress (1.5.0) 792 * 793 * @param string $value Text to append to the end of the excerpt. 794 */ 673 795 $ending = apply_filters( 'bp_excerpt_append_text', $r['ending'] ); 674 796 … … 768 890 } 769 891 892 /** 893 * Filters the final generated excerpt. 894 * 895 * @since BuddyPress (1.1.0) 896 * 897 * @param string $truncate Generated excerpt. 898 * @param string $original_text Original text provided. 899 * @param int $length Length of returned string, including ellipsis. 900 * @param array $options Array of HTML attributes and options. 901 */ 770 902 return apply_filters( 'bp_create_excerpt', $truncate, $original_text, $length, $options ); 771 903 } … … 794 926 */ 795 927 function bp_get_total_member_count() { 928 929 /** 930 * Filters the total member count in your BP instance. 931 * 932 * @since BuddyPress (1.2.0) 933 * 934 * @param int $value Member count. 935 */ 796 936 return apply_filters( 'bp_get_total_member_count', bp_core_get_active_member_count() ); 797 937 } … … 853 993 */ 854 994 function bp_registration_needs_activation() { 995 996 /** 997 * Filters whether registrations require activation on this installation. 998 * 999 * @since BuddyPress (1.2.0) 1000 * 1001 * @param bool $value Whether registrations require activation. Default true. 1002 */ 855 1003 return apply_filters( 'bp_registration_needs_activation', true ); 856 1004 } … … 890 1038 $subject = $r['before'] . wp_specialchars_decode( bp_get_option( 'blogname', $r['default'] ), ENT_QUOTES ) . $r['after'] . ' ' . $r['text']; 891 1039 1040 /** 1041 * Filters a client friendly version of the root blog name. 1042 * 1043 * @since BuddyPress (1.7.0) 1044 * 1045 * @param string $subject Client friendy version of the root blog name. 1046 * @param array $r Array of arguments for the email subject. 1047 */ 892 1048 return apply_filters( 'bp_get_email_subject', $subject, $r ); 893 1049 } … … 913 1069 } 914 1070 1071 /** 1072 * Filters the template paramenters to be used in the query string. 1073 * 1074 * Allows templates to pass parameters into the template loops via AJAX. 1075 * 1076 * @since BuddyPress (1.2.0) 1077 * 1078 * @param string $ajax_querystring Current query string. 1079 * @param string $object Current template component. 1080 */ 915 1081 return apply_filters( 'bp_ajax_querystring', $bp->ajax_querystring, $object ); 916 1082 } … … 929 1095 : false; 930 1096 1097 /** 1098 * Filters the name of the current component. 1099 * 1100 * @since BuddyPress (1.0.0) 1101 * 1102 * @param string|bool $current_component Current component if available or false. 1103 */ 931 1104 return apply_filters( 'bp_current_component', $current_component ); 932 1105 } … … 943 1116 : ''; 944 1117 1118 /** 1119 * Filters the name of the current action. 1120 * 1121 * @since BuddyPress (1.0.0) 1122 * 1123 * @param string $current_action Current action. 1124 */ 945 1125 return apply_filters( 'bp_current_action', $current_action ); 946 1126 } … … 957 1137 : false; 958 1138 1139 /** 1140 * Filters the name of the current item. 1141 * 1142 * @since BuddyPress (1.1.0) 1143 * 1144 * @param string|bool $current_item Current item if available or false. 1145 */ 959 1146 return apply_filters( 'bp_current_item', $current_item ); 960 1147 } … … 972 1159 : false; 973 1160 1161 /** 1162 * Filters the value of $bp->action_variables. 1163 * 1164 * @since BuddyPress (1.0.0) 1165 * 1166 * @param array|bool $action_variables Available action variables. 1167 */ 974 1168 return apply_filters( 'bp_action_variables', $action_variables ); 975 1169 } … … 990 1184 : false; 991 1185 1186 /** 1187 * Filters the value of a given action variable. 1188 * 1189 * @since BuddyPress (1.5.0) 1190 * 1191 * @param string|bool $action_variable Requested action variable based on position. 1192 * @param int $position The key of the action variable requested. 1193 */ 992 1194 return apply_filters( 'bp_action_variable', $action_variable, $position ); 993 1195 } … … 1014 1216 } 1015 1217 1218 /** 1219 * Filters the "root domain", the URL of the BP root blog. 1220 * 1221 * @since BuddyPress (1.2.4) 1222 * 1223 * @param string $domain URL of the BP root blog. 1224 */ 1016 1225 return apply_filters( 'bp_get_root_domain', $domain ); 1017 1226 } … … 1086 1295 } 1087 1296 1297 /** 1298 * Filters the root slug for given component. 1299 * 1300 * @since BuddyPress (1.5.0) 1301 * 1302 * @param string $root_slug Root slug for given component. 1303 * @param string $component Current component. 1304 */ 1088 1305 return apply_filters( 'bp_get_root_slug', $root_slug, $component ); 1089 1306 } … … 1125 1342 : false; 1126 1343 1344 /** 1345 * Filters whether or not a user has access. 1346 * 1347 * @since BuddyPress (1.2.4) 1348 * 1349 * @param bool $has_access Whether or not user has access. 1350 */ 1127 1351 return (bool) apply_filters( 'bp_user_has_access', $has_access ); 1128 1352 } … … 1146 1370 */ 1147 1371 function bp_get_search_slug() { 1372 1373 /** 1374 * Filters the search slug. 1375 * 1376 * @since BuddyPress (1.5.0) 1377 * 1378 * @param string BP_SEARCH_SLUG The search slug. Default "search". 1379 */ 1148 1380 return apply_filters( 'bp_get_search_slug', BP_SEARCH_SLUG ); 1149 1381 } … … 1162 1394 : 0; 1163 1395 1396 /** 1397 * Filters the ID of the currently displayed user. 1398 * 1399 * @since BuddyPress (1.0.0) 1400 * 1401 * @param int $id ID of the currently displayed user. 1402 */ 1164 1403 return (int) apply_filters( 'bp_displayed_user_id', $id ); 1165 1404 } … … 1178 1417 : 0; 1179 1418 1419 /** 1420 * Filters the ID of the currently logged-in user. 1421 * 1422 * @since BuddyPress (1.0.0) 1423 * 1424 * @param int $id ID of the currently logged-in user. 1425 */ 1180 1426 return (int) apply_filters( 'bp_loggedin_user_id', $id ); 1181 1427 } … … 1257 1503 } 1258 1504 1505 /** 1506 * Filters whether the current page belongs to the specified component. 1507 * 1508 * @since BuddyPress (1.5.0) 1509 * 1510 * @param bool $is_current_component Whether or not the current page belongs to specified component. 1511 * @param string $component Name of the component being checked. 1512 */ 1259 1513 return apply_filters( 'bp_is_current_component', $is_current_component, $component ); 1260 1514 } … … 1318 1572 } 1319 1573 1574 /** 1575 * Filters whether the current page matches a given action_variable. 1576 * 1577 * @since BuddyPress (1.5.0) 1578 * 1579 * @param bool $is_action_variable Whether the current page matches a given action_variable. 1580 * @param string $action_variable The action_variable being tested against. 1581 * @param int $position The array key tested against. 1582 */ 1320 1583 return apply_filters( 'bp_is_action_variable', $is_action_variable, $action_variable, $position ); 1321 1584 } … … 1330 1593 $retval = ( $item === bp_current_item() ); 1331 1594 1595 /** 1596 * Filters whether or not an item is the current item. 1597 * 1598 * @since BuddyPress (2.1.0) 1599 * 1600 * @param bool $retval Whether or not an item is the current item. 1601 * @param string $item The item being checked. 1602 */ 1332 1603 return (bool) apply_filters( 'bp_is_current_item', $retval, $item ); 1333 1604 } … … 1346 1617 } 1347 1618 1619 /** 1620 * Filters whether or not an item is the a single item. (group, user, etc) 1621 * 1622 * @since BuddyPress (2.1.0) 1623 * 1624 * @param bool $retval Whether or not an item is a single item. 1625 */ 1348 1626 return (bool) apply_filters( 'bp_is_single_item', $retval ); 1349 1627 } … … 1363 1641 } 1364 1642 1643 /** 1644 * Filters whether or not the logged-in user is an admin for the current item. 1645 * 1646 * @since BuddyPress (2.1.0) 1647 * 1648 * @param bool $retval Whether or not the logged-in user is an admin. 1649 */ 1365 1650 return (bool) apply_filters( 'bp_is_item_admin', $retval ); 1366 1651 } … … 1380 1665 } 1381 1666 1667 /** 1668 * Filters whether or not the logged-in user is a mod for the current item. 1669 * 1670 * @since BuddyPress (2.1.0) 1671 * 1672 * @param bool $retval Whether or not the logged-in user is a mod. 1673 */ 1382 1674 return (bool) apply_filters( 'bp_is_item_mod', $retval ); 1383 1675 } … … 1397 1689 } 1398 1690 1691 /** 1692 * Filters whether or not user is on a component directory page. 1693 * 1694 * @since BuddyPress (2.1.0) 1695 * 1696 * @param bool $retval Whether or not user is on a component directory page. 1697 */ 1399 1698 return (bool) apply_filters( 'bp_is_directory', $retval ); 1400 1699 } … … 1430 1729 } 1431 1730 1731 /** 1732 * Filters whether or not a component's URL should be in the root, not under a member page. 1733 * 1734 * @since BuddyPress (2.1.0) 1735 * 1736 * @param bool $retval Whether or not URL should be in the root. 1737 */ 1432 1738 return (bool) apply_filters( 'bp_is_root_component', $retval ); 1433 1739 } … … 1470 1776 } 1471 1777 1778 /** 1779 * Filters whether or not the specified BuddyPress component directory is set to be the front page. 1780 * 1781 * @since BuddyPress (1.5.0) 1782 * 1783 * @param bool $value Whether or not the specified component directory is set as front page. 1784 * @param string $component Current component being checked. 1785 */ 1472 1786 return (bool) apply_filters( 'bp_is_component_front_page', ( $bp->pages->{$component}->id == $page_on_front ), $component ); 1473 1787 } … … 1492 1806 } 1493 1807 1808 /** 1809 * Filters whether or not current page is a blog page or not. 1810 * 1811 * @since BuddyPress (1.5.0) 1812 * 1813 * @param bool $is_blog_page Whether or not current page is a blog page. 1814 */ 1494 1815 return (bool) apply_filters( 'bp_is_blog_page', $is_blog_page ); 1495 1816 } … … 1512 1833 $retval = (bool) ( bp_current_component() || bp_is_user() ); 1513 1834 1835 /** 1836 * Filters whether or not this is a BuddyPress component. 1837 * 1838 * @since BuddyPress (1.7.0) 1839 * 1840 * @param bool $retval Whether or not this is a BuddyPress component. 1841 */ 1514 1842 return apply_filters( 'is_buddypress', $retval ); 1515 1843 } … … 1536 1864 } 1537 1865 1866 /** 1867 * Filters whether or not a given component has been activated by the admin. 1868 * 1869 * @since BuddyPress (2.1.0) 1870 * 1871 * @param bool $retval Whether or not a given component has been activated by the admin. 1872 * @param string $component Current component being checked. 1873 */ 1538 1874 return apply_filters( 'bp_is_active', $retval, $component ); 1539 1875 } … … 1714 2050 } 1715 2051 2052 /** 2053 * Filters whether or not current page is part of the profile for the logged-in user. 2054 * 2055 * @since BuddyPress (1.2.4) 2056 * 2057 * @param bool $my_profile Whether or not current page is part of the profile for the logged-in user. 2058 */ 1716 2059 return apply_filters( 'bp_is_my_profile', $my_profile ); 1717 2060 } … … 2535 2878 $classes = array_unique( array_merge( (array) $bp_classes, (array) $wp_classes ) ); 2536 2879 2880 /** 2881 * Filters the BuddyPress classes to be added to body_class() 2882 * 2883 * @since BuddyPress (1.1.0) 2884 * 2885 * @param array $classes Array of body classes to add. 2886 * @param array $bp_classes Array of BuddyPress-based classes. 2887 * @param array $wp_classes Array of WordPress-based classes. 2888 * @param array $custom_classes Array of classes that were passed to get_body_class(). 2889 */ 2537 2890 return apply_filters( 'bp_get_the_body_class', $classes, $bp_classes, $wp_classes, $custom_classes ); 2538 2891 } … … 2703 3056 } 2704 3057 3058 /** 3059 * Filters the items registered in the primary and secondary BuddyPress navigation menus. 3060 * 3061 * @since BuddyPress (1.7.0) 3062 * 3063 * @param array $menus Array of items registered in the primary and secondary BuddyPress navigation. 3064 */ 2705 3065 return apply_filters( 'bp_get_nav_menu_items', $menus ); 2706 3066 } … … 2762 3122 ); 2763 3123 $args = wp_parse_args( $args, $defaults ); 3124 3125 /** 3126 * Filters the parsed bp_nav_menu arguments. 3127 * 3128 * @since BuddyPress (1.7.0) 3129 * 3130 * @param array $args Array of parsed arguments. 3131 */ 2764 3132 $args = apply_filters( 'bp_nav_menu_args', $args ); 2765 3133 $args = (object) $args; … … 2779 3147 // Whether to wrap the ul, and what to wrap it with 2780 3148 if ( $args->container ) { 3149 3150 /** 3151 * Filters the allowed tags for the wp_nav_menu_container. 3152 * 3153 * @since BuddyPress (1.7.0) 3154 * 3155 * @param array $value Array of allowed tags. Default 'div' and 'nav'. 3156 */ 2781 3157 $allowed_tags = apply_filters( 'wp_nav_menu_container_allowedtags', array( 'div', 'nav', ) ); 2782 3158 … … 2790 3166 } 2791 3167 2792 // Get the BuddyPress menu items 3168 /** 3169 * Filters the BuddyPress menu objects. 3170 * 3171 * @since BuddyPress (1.7.0) 3172 * 3173 * @param array $value Array of nav menu objects. 3174 * @param array $args Array of arguments for the menu. 3175 */ 2793 3176 $menu_items = apply_filters( 'bp_nav_menu_objects', bp_get_nav_menu_items(), $args ); 2794 3177 $items = walk_nav_menu_tree( $menu_items, $args->depth, $args ); … … 2813 3196 $menu_id_slugs[] = $wrap_id; 2814 3197 2815 // Allow plugins to hook into the menu to add their own <li>'s 3198 /** 3199 * Filters the BuddyPress menu items. 3200 * 3201 * Allow plugins to hook into the menu to add their own <li>'s 3202 * 3203 * @since BuddyPress (1.7.0) 3204 * 3205 * @param array $items Array of nav menu items. 3206 * @param array $args Array of arguments for the menu. 3207 */ 2816 3208 $items = apply_filters( 'bp_nav_menu_items', $items, $args ); 2817 3209 … … 2826 3218 } 2827 3219 2828 // Final chance to modify output 3220 /** 3221 * Filters the final BuddyPress menu output. 3222 * 3223 * @since BuddyPress (1.7.0) 3224 * 3225 * @param string $nav_menu Final nav menu output. 3226 * @param array $args Array of arguments for the menu. 3227 */ 2829 3228 $nav_menu = apply_filters( 'bp_nav_menu', $nav_menu, $args ); 2830 3229 -
trunk/src/bp-core/classes/class-bp-attachment-avatar.php
r9704 r9715 197 197 198 198 if ( empty( $args['item_id'] ) ) { 199 200 /** This filter is documented in bp-core/bp-core-avatars.php */ 199 201 $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', dirname( $absolute_path ), $args['item_id'], $args['object'], $args['avatar_dir'] ); 200 202 } else { 203 204 /** This filter is documented in bp-core/bp-core-avatars.php */ 201 205 $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', $this->upload_path . '/' . $args['avatar_dir'] . '/' . $args['item_id'], $args['item_id'], $args['object'], $args['avatar_dir'] ); 202 206 }
Note: See TracChangeset
for help on using the changeset viewer.