Changeset 10497 for trunk/src/bp-core/bp-core-template.php
- Timestamp:
- 02/03/2016 05:01:13 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-template.php
r10487 r10497 24 24 * The function will also analyze the current action for the current component 25 25 * to determine whether or not to highlight a particular sub nav item. 26 * 27 * @since 1.0.0 26 28 * 27 29 * @uses bp_get_user_nav() Renders the navigation for a profile of a currently … … 209 211 /** 210 212 * Output the current avatar upload step. 213 * 214 * @since 1.1.0 211 215 */ 212 216 function bp_avatar_admin_step() { … … 215 219 /** 216 220 * Return the current avatar upload step. 221 * 222 * @since 1.1.0 217 223 * 218 224 * @return string The current avatar upload step. Returns 'upload-image' … … 237 243 /** 238 244 * Output the URL of the avatar to crop. 245 * 246 * @since 1.1.0 239 247 */ 240 248 function bp_avatar_to_crop() { … … 243 251 /** 244 252 * Return the URL of the avatar to crop. 253 * 254 * @since 1.1.0 245 255 * 246 256 * @return string URL of the avatar awaiting cropping. … … 264 274 /** 265 275 * Output the relative file path to the avatar to crop. 276 * 277 * @since 1.1.0 266 278 */ 267 279 function bp_avatar_to_crop_src() { … … 270 282 /** 271 283 * Return the relative file path to the avatar to crop. 284 * 285 * @since 1.1.0 272 286 * 273 287 * @return string Relative file path to the avatar. … … 304 318 /** 305 319 * Output the name of the BP site. Used in RSS headers. 320 * 321 * @since 1.0.0 306 322 */ 307 323 function bp_site_name() { … … 416 432 * do the necessary argument swapping for dynamic phrases. 417 433 * 434 * @since 1.0.0 435 * 418 436 * @param string $youtext The "you" version of the phrase (eg "Your Friends"). 419 437 * @param string $nametext The other-user version of the phrase. Should be in … … 479 497 /** 480 498 * Return the "action" attribute for search forms. 499 * 500 * @since 1.0.0 481 501 * 482 502 * @return string URL action attribute for search forms, eg example.com/search/. … … 707 727 * Create and output a button. 708 728 * 729 * @since 1.2.6 730 * 709 731 * @see bp_get_button() 710 732 * … … 716 738 /** 717 739 * Create and return a button. 740 * 741 * @since 1.2.6 718 742 * 719 743 * @see BP_Button for a description of arguments and return value. … … 752 776 * - `html` If true, HTML tags would be handled correctly. 753 777 * - `filter_shortcodes` If true, shortcodes will be stripped before truncating. 778 * 779 * @since 1.0.0 754 780 * 755 781 * @param string $text String to truncate. … … 963 989 /** 964 990 * Output the total member count for the site. 991 * 992 * @since 1.2.0 965 993 */ 966 994 function bp_total_member_count() { … … 978 1006 * which did not take into account last_activity, and thus often 979 1007 * resulted in higher counts than shown by member directory pagination. 1008 * 1009 * @since 1.2.0 980 1010 * 981 1011 * @return int Member count. … … 1008 1038 * Network Admin > Settings. 1009 1039 * 1040 * @since 1.2.0 1041 * 1010 1042 * @return bool True if blog signup is allowed, otherwise false. 1011 1043 */ … … 1026 1058 /** 1027 1059 * Check whether an activation has just been completed. 1060 * 1061 * @since 1.1.0 1028 1062 * 1029 1063 * @return bool True if the activation_complete global flag has been set, … … 1045 1079 * activation. This filter exists so that customizations that omit activation 1046 1080 * can remove certain notification text from the registration screen. 1081 * 1082 * @since 1.2.0 1047 1083 * 1048 1084 * @return bool True by default. … … 1116 1152 * WordPress theme without coping the functions from functions.php. 1117 1153 * 1154 * @since 1.2.0 1155 * 1118 1156 * @param string|bool $object Current template component. 1119 1157 * @return string The AJAX querystring. … … 1143 1181 /** 1144 1182 * Return the name of the current component. 1183 * 1184 * @since 1.0.0 1145 1185 * 1146 1186 * @return string Component name. … … 1165 1205 * Return the name of the current action. 1166 1206 * 1207 * @since 1.0.0 1208 * 1167 1209 * @return string Action name. 1168 1210 */ … … 1186 1228 * Return the name of the current item. 1187 1229 * 1230 * @since 1.1.0 1231 * 1188 1232 * @return string|bool 1189 1233 */ … … 1207 1251 * Return the value of $bp->action_variables. 1208 1252 * 1253 * @since 1.0.0 1254 * 1209 1255 * @return array|bool $action_variables The action variables array, or false 1210 1256 * if the array is empty. … … 1254 1300 /** 1255 1301 * Output the "root domain", the URL of the BP root blog. 1302 * 1303 * @since 1.1.0 1256 1304 */ 1257 1305 function bp_root_domain() { … … 1260 1308 /** 1261 1309 * Return the "root domain", the URL of the BP root blog. 1310 * 1311 * @since 1.1.0 1262 1312 * 1263 1313 * @return string URL of the BP root blog. … … 1394 1444 } 1395 1445 1446 /** 1447 * Returns whether or not a user has access. 1448 * 1449 * @since 1.2.4 1450 * 1451 * @return bool 1452 */ 1396 1453 function bp_user_has_access() { 1397 1454 $has_access = bp_current_user_can( 'bp_moderate' ) || bp_is_my_profile(); … … 1439 1496 * Get the ID of the currently displayed user. 1440 1497 * 1498 * @since 1.0.0 1499 * 1441 1500 * @uses apply_filters() Filter 'bp_displayed_user_id' to change this value. 1442 1501 * … … 1461 1520 /** 1462 1521 * Get the ID of the currently logged-in user. 1522 * 1523 * @since 1.0.0 1463 1524 * 1464 1525 * @uses apply_filters() Filter 'bp_loggedin_user_id' to change this value. … … 1642 1703 * Check against the current_item. 1643 1704 * 1705 * @since 1.5.0 1706 * 1644 1707 * @param string $item The item being checked. 1645 1708 * @return bool True if $item is the current item. … … 1661 1724 /** 1662 1725 * Are we looking at a single item? (group, user, etc). 1726 * 1727 * @since 1.1.0 1663 1728 * 1664 1729 * @return bool True if looking at a single item, otherwise false. … … 1685 1750 * Is the logged-in user an admin for the current item? 1686 1751 * 1752 * @since 1.5.0 1753 * 1687 1754 * @return bool True if the current user is an admin for the current item, 1688 1755 * otherwise false. … … 1709 1776 * Is the logged-in user a mod for the current item? 1710 1777 * 1778 * @since 1.5.0 1779 * 1711 1780 * @return bool True if the current user is a mod for the current item, 1712 1781 * otherwise false. … … 1733 1802 * Is this a component directory page? 1734 1803 * 1804 * @since 1.0.0 1805 * 1735 1806 * @return bool True if the current page is a component directory, otherwise false. 1736 1807 */ … … 1761 1832 * This function is on the chopping block. It's currently only used by a few 1762 1833 * already deprecated functions. 1834 * 1835 * @since 1.5.0 1763 1836 * 1764 1837 * @param string $component_name Component name to check. … … 1848 1921 * You can tell if a page is displaying BP content by whether the 1849 1922 * current_component has been defined. 1923 * 1924 * @since 1.0.0 1850 1925 * 1851 1926 * @return bool True if it's a non-BP page, false otherwise. … … 1962 2037 * Check whether the current page is part of the Members component. 1963 2038 * 2039 * @since 1.5.0 2040 * 1964 2041 * @return bool True if the current page is part of the Members component. 1965 2042 */ … … 1971 2048 * Check whether the current page is part of the Profile component. 1972 2049 * 2050 * @since 1.1.0 2051 * 1973 2052 * @return bool True if the current page is part of the Profile component. 1974 2053 */ … … 1980 2059 * Check whether the current page is part of the Activity component. 1981 2060 * 2061 * @since 1.1.0 2062 * 1982 2063 * @return bool True if the current page is part of the Activity component. 1983 2064 */ … … 1989 2070 * Check whether the current page is part of the Blogs component. 1990 2071 * 2072 * @since 1.1.0 2073 * 1991 2074 * @return bool True if the current page is part of the Blogs component. 1992 2075 */ … … 1998 2081 * Check whether the current page is part of the Messages component. 1999 2082 * 2083 * @since 1.1.0 2084 * 2000 2085 * @return bool True if the current page is part of the Messages component. 2001 2086 */ … … 2007 2092 * Check whether the current page is part of the Friends component. 2008 2093 * 2094 * @since 1.1.0 2095 * 2009 2096 * @return bool True if the current page is part of the Friends component. 2010 2097 */ … … 2016 2103 * Check whether the current page is part of the Groups component. 2017 2104 * 2105 * @since 1.1.0 2106 * 2018 2107 * @return bool True if the current page is part of the Groups component. 2019 2108 */ … … 2025 2114 * Check whether the current page is part of the Forums component. 2026 2115 * 2116 * @since 1.5.0 2117 * 2027 2118 * @return bool True if the current page is part of the Forums component. 2028 2119 */ … … 2044 2135 /** 2045 2136 * Check whether the current page is part of the Settings component. 2137 * 2138 * @since 1.1.0 2046 2139 * 2047 2140 * @return bool True if the current page is part of the Settings component. … … 2060 2153 * BuddyPress core, it will return true. 2061 2154 * 2155 * @since 1.7.0 2156 * 2062 2157 * @return bool True if the current component is active and is one of BP's 2063 2158 * packaged components. … … 2096 2191 * Is the current page a single activity item permalink? 2097 2192 * 2193 * @since 1.5.0 2194 * 2098 2195 * @return bool True if the current page is a single activity item permalink. 2099 2196 */ … … 2124 2221 * Will return true for any subpage of the logged-in user's profile, eg 2125 2222 * http://example.com/members/joe/friends/. 2223 * 2224 * @since 1.2.0 2126 2225 * 2127 2226 * @return bool True if the current page is part of the profile of the logged-in user. … … 2149 2248 * Will return true anytime there is a displayed user. 2150 2249 * 2250 * @since 1.5.0 2251 * 2151 2252 * @return bool True if the current page is a user page. 2152 2253 */ … … 2160 2261 * Eg http://example.com/members/joe/activity/ (or any subpages thereof). 2161 2262 * 2263 * @since 1.1.0 2264 * 2162 2265 * @return bool True if the current page is a user's activity stream page. 2163 2266 */ … … 2171 2274 * Eg http://example.com/members/joe/friends/ 2172 2275 * 2276 * @since 1.1.0 2277 * 2173 2278 * @return bool True if the current page is a user's Friends activity stream. 2174 2279 */ … … 2196 2301 * 2197 2302 * Eg http://example.com/members/joe/groups/ 2303 * 2304 * @since 1.5.0 2198 2305 * 2199 2306 * @return bool True if the current page is a user's Groups activity stream. … … 2221 2328 * Eg http://example.com/members/joe/profile/ (or a subpage thereof). 2222 2329 * 2330 * @since 1.1.0 2331 * 2223 2332 * @return bool True if the current page is part of a user's extended profile. 2224 2333 */ … … 2232 2341 * Eg http://example.com/members/joe/profile/edit/ (or a subpage thereof). 2233 2342 * 2343 * @since 1.5.0 2344 * 2234 2345 * @return bool True if the current page is a user's profile edit page. 2235 2346 */ … … 2238 2349 } 2239 2350 2351 /** 2352 * Is the current page part of a user's profile avatar editing section? 2353 * 2354 * Eg http://example.com/members/joe/profile/change-avatar/ (or a subpage thereof). 2355 * 2356 * @since 1.5.0 2357 * 2358 * @return bool True if the current page is the user's avatar edit page. 2359 */ 2240 2360 function bp_is_user_change_avatar() { 2241 2361 return (bool) ( bp_is_profile_component() && bp_is_current_action( 'change-avatar' ) ); … … 2260 2380 * Eg http://example.com/members/joe/forums/ (or a subpage thereof). 2261 2381 * 2382 * @since 1.5.0 2383 * 2262 2384 * @return bool True if the current page is a user's forums page. 2263 2385 */ … … 2306 2428 * Eg http://example.com/members/joe/groups/ (or a subpage thereof). 2307 2429 * 2430 * @since 1.1.0 2431 * 2308 2432 * @return bool True if the current page is a user's Groups page. 2309 2433 */ … … 2317 2441 * Eg http://example.com/members/joe/blogs/ (or a subpage thereof). 2318 2442 * 2443 * @since 1.1.0 2444 * 2319 2445 * @return bool True if the current page is a user's Blogs page. 2320 2446 */ … … 2328 2454 * Eg http://example.com/members/joe/blogs/recent-posts/. 2329 2455 * 2456 * @since 1.1.0 2457 * 2330 2458 * @return bool True if the current page is a user's Recent Blog Posts page. 2331 2459 */ … … 2339 2467 * Eg http://example.com/members/joe/blogs/recent-comments/. 2340 2468 * 2469 * @since 1.1.0 2470 * 2341 2471 * @return bool True if the current page is a user's Recent Blog Comments page. 2342 2472 */ … … 2350 2480 * Eg http://example.com/members/joe/blogs/friends/ (or a subpage thereof). 2351 2481 * 2482 * @since 1.1.0 2483 * 2352 2484 * @return bool True if the current page is a user's Friends page. 2353 2485 */ … … 2361 2493 * Eg http://example.com/members/joe/friends/requests/. 2362 2494 * 2495 * @since 1.5.0 2496 * 2363 2497 * @return bool True if the current page is a user's Friends Requests page. 2364 2498 */ … … 2384 2518 * 2385 2519 * Eg http://example.com/members/joe/settings/ (or a subpage thereof). 2520 * 2521 * @since 1.5.0 2386 2522 * 2387 2523 * @return bool True if the current page is a user's Settings page. … … 2465 2601 * Will return true for any subpage of a single group. 2466 2602 * 2603 * @since 1.2.0 2604 * 2467 2605 * @return bool True if the current page is part of a single group. 2468 2606 */ … … 2482 2620 * URL will vary depending on which group tab is set to be the "home". By 2483 2621 * default, it's the group's recent activity. 2622 * 2623 * @since 1.1.0 2484 2624 * 2485 2625 * @return bool True if the current page is a single group's home page. … … 2496 2636 * Is the current page part of the group creation process? 2497 2637 * 2638 * @since 1.1.0 2639 * 2498 2640 * @return bool True if the current page is part of the group creation process. 2499 2641 */ … … 2507 2649 * Eg http://example.com/groups/mygroup/admin/settings/. 2508 2650 * 2651 * @since 1.1.0 2652 * 2509 2653 * @return bool True if the current page is part of a single group's admin. 2510 2654 */ … … 2517 2661 * 2518 2662 * Only applies to legacy bbPress forums. 2663 * 2664 * @since 1.1.0 2519 2665 * 2520 2666 * @return bool True if the current page is a group forum page. … … 2540 2686 * Is the current page a group's activity page? 2541 2687 * 2688 * @since 1.2.1 2689 * 2542 2690 * @return True if the current page is a group's activity page. 2543 2691 */ … … 2561 2709 * Only applies to legacy bbPress (1.x) forums. 2562 2710 * 2711 * @since 1.1.0 2712 * 2563 2713 * @return bool True if the current page is part of a group forum topic. 2564 2714 */ … … 2572 2722 * Only applies to legacy bbPress (1.x) forums. 2573 2723 * 2724 * @since 1.2.0 2725 * 2574 2726 * @return bool True if the current page is part of a group forum topic edit page. 2575 2727 */ … … 2583 2735 * Eg http://example.com/groups/mygroup/members/. 2584 2736 * 2737 * @since 1.1.0 2738 * 2585 2739 * @return bool True if the current page is part of a group's Members page. 2586 2740 */ … … 2604 2758 * Eg http://example.com/groups/mygroup/send-invites/. 2605 2759 * 2760 * @since 1.1.0 2761 * 2606 2762 * @return bool True if the current page is a group's Send Invites page. 2607 2763 */ … … 2615 2771 * Eg http://example.com/groups/mygroup/request-membership/. 2616 2772 * 2773 * @since 1.2.0 2774 * 2617 2775 * @return bool True if the current page is a group's Request Membership page. 2618 2776 */ … … 2623 2781 /** 2624 2782 * Is the current page a leave group attempt? 2783 * 2784 * @since 1.1.0 2625 2785 * 2626 2786 * @return bool True if the current page is a Leave Group attempt. … … 2660 2820 * Eg http://example.com/sites/create/. 2661 2821 * 2822 * @since 1.1.0 2823 * 2662 2824 * @return bool True if the current page is the Create a Blog page. 2663 2825 */ … … 2688 2850 * Eg http://example.com/members/joe/messages/ (or a subpage thereof). 2689 2851 * 2852 * @since 1.2.0 2853 * 2690 2854 * @return bool True if the current page is part of a user's Messages pages. 2691 2855 */ … … 2698 2862 * 2699 2863 * Eg http://example.com/members/joe/messages/inbox/. 2864 * 2865 * @since 1.1.0 2700 2866 * 2701 2867 * @return bool True if the current page is a user's Messages Inbox. … … 2714 2880 * Eg http://example.com/members/joe/messages/sentbox/. 2715 2881 * 2882 * @since 1.1.0 2883 * 2716 2884 * @return bool True if the current page is a user's Messages Sentbox. 2717 2885 */ … … 2725 2893 * Eg http://example.com/members/joe/messages/compose/. 2726 2894 * 2895 * @since 1.1.0 2896 * 2727 2897 * @return bool True if the current page is a user's Messages Compose screen. 2728 2898 */ … … 2736 2906 * Eg http://example.com/members/joe/messages/notices/. 2737 2907 * 2908 * @since 1.1.0 2909 * 2738 2910 * @return bool True if the current page is the Notices screen. 2739 2911 */ … … 2744 2916 /** 2745 2917 * Is the current page a single Messages conversation thread? 2918 * 2919 * @since 1.6.0 2746 2920 * 2747 2921 * @return bool True if the current page a single Messages conversation thread? … … 2769 2943 * Eg http://example.com/activate/. 2770 2944 * 2945 * @since 1.1.0 2946 * 2771 2947 * @return bool True if the current page is the Activate page. 2772 2948 */ … … 2780 2956 * Eg http://example.com/register/. 2781 2957 * 2958 * @since 1.1.0 2959 * 2782 2960 * @return bool True if the current page is the Register page. 2783 2961 */ … … 2791 2969 * @since 2.4.3 2792 2970 * 2793 * @param string $seplocation 2971 * @param string $seplocation Location for the separator. 2794 2972 * @return array the title parts 2795 2973 */ … … 2797 2975 $bp = buddypress(); 2798 2976 2799 // Defaults to an empty array 2977 // Defaults to an empty array. 2800 2978 $bp_title_parts = array(); 2801 2979 … … 2926 3104 /** 2927 3105 * Customize the body class, according to the currently displayed BP content. 3106 * 3107 * @since 1.1.0 2928 3108 */ 2929 3109 function bp_the_body_class() { … … 2934 3114 * 2935 3115 * Uses the above is_() functions to output a body class for each scenario. 3116 * 3117 * @since 1.1.0 2936 3118 * 2937 3119 * @param array $wp_classes The body classes coming from WP.
Note: See TracChangeset
for help on using the changeset viewer.