Changeset 10039 for trunk/src/bp-core/bp-core-functions.php
- Timestamp:
- 08/09/2015 05:07:56 AM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-core/bp-core-functions.php (modified) (39 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-functions.php
r10016 r10039 65 65 } 66 66 /** 67 * Return the BuddyPress database version 67 * Return the BuddyPress database version. 68 68 * 69 69 * @since BuddyPress (1.6) … … 170 170 * Format numbers the BuddyPress way. 171 171 * 172 * @param int $numberThe number to be formatted.172 * @param int $number The number to be formatted. 173 173 * @param bool $decimals Whether to use decimals. See {@link number_format_i18n()}. 174 * 174 175 * @return string The formatted number. 175 176 */ … … 224 225 * 225 226 * @since BuddyPress (1.6) 227 * 226 228 * @param array $old_args_keys Old argument indexs, keyed to their positions. 227 * @param array $func_args The parameters passed to the originating function. 229 * @param array $func_args The parameters passed to the originating function. 230 * 228 231 * @return array $new_args The parsed arguments. 229 232 */ … … 251 254 * @since BuddyPress (r7704) 252 255 * 253 * @param string|array $args Value to merge with $defaults 254 * @param array $defaults Array that serves as the defaults. 255 * @param string $filter_key String to key the filters from 256 * @param string|array $args Value to merge with $defaults. 257 * @param array $defaults Array that serves as the defaults. 258 * @param string $filter_key String to key the filters from. 259 * 256 260 * @return array Merged user defined values with defaults. 257 261 */ … … 313 317 * @since BuddyPress (2.2.0) 314 318 * 315 * @param string $page_arg The $_REQUEST argument to look for 316 * @param int $page The original page value to fall back to 317 * @return int A sanitized integer value, good for pagination 319 * @param string $page_arg The $_REQUEST argument to look for. 320 * @param int $page The original page value to fall back to. 321 * 322 * @return int A sanitized integer value, good for pagination. 318 323 */ 319 324 function bp_sanitize_pagination_arg( $page_arg = '', $page = 1 ) { … … 344 349 * 345 350 * @param string $order The 'order' string, as passed to the SQL constructor. 351 * 346 352 * @return string The sanitized value 'DESC' or 'ASC'. 347 353 */ … … 364 370 * 365 371 * @param string $text The raw text to be escaped. 372 * 366 373 * @return string Text in the form of a LIKE phrase. Not SQL safe. Run through 367 * wpdb::prepare() before use.374 * wpdb::prepare() before use. 368 375 */ 369 376 function bp_esc_like( $text ) { … … 386 393 * 387 394 * @return bool False when compatibility mode is disabled, true when enabled. 388 * Default: false.395 * Default: false. 389 396 */ 390 397 function bp_is_username_compatibility_mode() { … … 475 482 * pages. When running save routines, use 'all' to avoid removing data related to inactive 476 483 * components. Default: 'active'. 484 * 477 485 * @return array|string An array of page IDs, keyed by component names, or an 478 486 * empty string if the list is not found. … … 526 534 * 527 535 * @param array $blog_page_ids The IDs of the WP pages corresponding to BP 528 * component directories.536 * component directories. 529 537 */ 530 538 function bp_core_update_directory_page_ids( $blog_page_ids ) { … … 608 616 * @since BuddyPress (1.7.0) 609 617 * 610 * @param array $components Components to create pages for.611 * @param string $existing 'delete' if you want to delete existing page612 * mappingsand replace with new ones. Otherwise existing page mappings613 * are kept, and the gaps filled in with new pages. Default: 'keep'.618 * @param array $components Components to create pages for. 619 * @param string $existing 'delete' if you want to delete existing page mappings 620 * and replace with new ones. Otherwise existing page mappings 621 * are kept, and the gaps filled in with new pages. Default: 'keep'. 614 622 */ 615 623 function bp_core_add_page_mappings( $components, $existing = 'keep' ) { … … 749 757 * 750 758 * @param string $root_slug The root slug, which comes from $bp->pages->[component]->slug. 759 * 751 760 * @return string The short slug for use in the middle of URLs. 752 761 */ … … 914 923 * 915 924 * @param string $location The redirect URL. 916 * @param int $statusOptional. The numeric code to give in the redirect917 * headers. Default: 302.925 * @param int $status Optional. The numeric code to give in the redirect 926 * headers. Default: 302. 918 927 */ 919 928 function bp_core_redirect( $location = '', $status = 302 ) { … … 1006 1015 * @since BuddyPress (1.2.6) 1007 1016 * 1008 * @param bool $gmtTrue to use GMT (rather than local) time. Default: true.1017 * @param bool $gmt True to use GMT (rather than local) time. Default: true. 1009 1018 * @param string $type See the 'type' parameter in {@link current_time()}. 1010 Default: 'mysql'. 1019 * Default: 'mysql'. 1020 * 1011 1021 * @return string Current time in 'Y-m-d h:i:s' format. 1012 1022 */ … … 1042 1052 * 1043 1053 * @param int|string $older_date The earlier time from which you're calculating 1044 * the time elapsed. Enter either as an integer Unix timestamp, or as a 1045 * date string of the format 'Y-m-d h:i:s'. 1046 * @param int|bool $newer_date Optional. Unix timestamp of date to compare older 1047 * date to. Default: false (current time). 1054 * the time elapsed. Enter either as an integer Unix timestamp, 1055 * or as a date string of the format 'Y-m-d h:i:s'. 1056 * @param int|bool $newer_date Optional. Unix timestamp of date to compare older 1057 * date to. Default: false (current time). 1058 * 1048 1059 * @return string String representing the time since the older date, eg 1049 1060 * "2 hours and 50 minutes". … … 1238 1249 * 1239 1250 * @param string $message Feedback message to be displayed. 1240 * @param string $type Message type. 'updated', 'success', 'error', 'warning'.1241 * Default: 'success'.1251 * @param string $type Message type. 'updated', 'success', 'error', 'warning'. 1252 * Default: 'success'. 1242 1253 */ 1243 1254 function bp_core_add_message( $message, $type = '' ) { … … 1413 1424 * 1414 1425 * @param int|string $last_activity_date The date of last activity. 1415 * @param string $string A sprintf()-able statement of the form 'active %s' 1426 * @param string $string A sprintf()-able statement of the form 'active %s'. 1427 * 1416 1428 * @return string $last_active A string of the form '3 years ago'. 1417 1429 */ … … 1463 1475 * 1464 1476 * @param string|bool $key The usermeta meta_key. 1477 * 1465 1478 * @return string $key The usermeta meta_key. 1466 1479 */ … … 1489 1502 * @uses bp_get_user_meta_key() For a filterable version of the meta key. 1490 1503 * 1491 * @param int $user_id The ID of the user whose meta you're fetching. 1492 * @param string $key The meta key to retrieve. 1493 * @param bool $single Whether to return a single value. 1504 * @param int $user_id The ID of the user whose meta you're fetching. 1505 * @param string $key The meta key to retrieve. 1506 * @param bool $single Whether to return a single value. 1507 * 1494 1508 * @return mixed Will be an array if $single is false. Will be value of meta data field if $single 1495 1509 * is true. … … 1511 1525 * @uses bp_get_user_meta_key() For a filterable version of the meta key. 1512 1526 * 1513 * @param int $user_id The ID of the user whose meta you're setting. 1514 * @param string $key The meta key to set. 1515 * @param mixed $value Metadata value. 1516 * @param mixed $prev_value Optional. Previous value to check before removing. 1527 * @param int $user_id The ID of the user whose meta you're setting. 1528 * @param string $key The meta key to set. 1529 * @param mixed $value Metadata value. 1530 * @param mixed $prev_value Optional. Previous value to check before removing. 1531 * 1517 1532 * @return bool False on failure, true on success. 1518 1533 */ … … 1533 1548 * @uses bp_get_user_meta_key() For a filterable version of the meta key. 1534 1549 * 1535 * @param int $user_id The ID of the user whose meta you're deleting. 1536 * @param string $key The meta key to delete. 1537 * @param mixed $value Optional. Metadata value. 1550 * @param int $user_id The ID of the user whose meta you're deleting. 1551 * @param string $key The meta key to delete. 1552 * @param mixed $value Optional. Metadata value. 1553 * 1538 1554 * @return bool False for failure. True for success. 1539 1555 */ … … 1566 1582 * 1567 1583 * @return bool False when activity embed support is disabled; true when 1568 * enabled. Default: true.1584 * enabled. Default: true. 1569 1585 */ 1570 1586 function bp_use_embed_in_activity() { … … 1586 1602 * 1587 1603 * @return bool False when activity replies embed support is disabled; true 1588 * when enabled. Default: true.1604 * when enabled. Default: true. 1589 1605 */ 1590 1606 function bp_use_embed_in_activity_replies() { … … 1606 1622 * 1607 1623 * @return bool False when forum post embed support is disabled; true when 1608 * enabled. Default: true.1624 * enabled. Default: true. 1609 1625 */ 1610 1626 function bp_use_embed_in_forum_posts() { … … 1626 1642 * 1627 1643 * @return bool False when private message embed support is disabled; true when 1628 * enabled. Default: true.1644 * enabled. Default: true. 1629 1645 */ 1630 1646 function bp_use_embed_in_private_messages() { … … 1649 1665 * @see bp_get_admin_url() For description of parameters. 1650 1666 * 1651 * @param string $path See {@link bp_get_admin_url()}.1667 * @param string $path See {@link bp_get_admin_url()}. 1652 1668 * @param string $scheme See {@link bp_get_admin_url()}. 1653 1669 */ … … 1664 1680 * @uses admin_url() 1665 1681 * 1666 * @param string $path Optional. The sub-path under /wp-admin to be1667 * appended to the admin URL.1682 * @param string $path Optional. The sub-path under /wp-admin to be 1683 * appended to the admin URL. 1668 1684 * @param string $scheme The scheme to use. Default is 'admin', which 1669 * obeys {@link force_ssl_admin()} and {@link is_ssl()}. 'http' 1670 * or 'https' can be passed to force those schemes. 1685 * obeys {@link force_ssl_admin()} and {@link is_ssl()}. 'http' 1686 * or 'https' can be passed to force those schemes. 1687 * 1671 1688 * @return string Admin url link with optional path appended. 1672 1689 */ … … 1698 1715 * 1699 1716 * @return bool True if the BP admin screen should appear in the Network Admin, 1700 * otherwise false.1717 * otherwise false. 1701 1718 */ 1702 1719 function bp_core_do_network_admin() { … … 1752 1769 * 1753 1770 * @param int $blog_id Optional. Default: the ID of the current blog. 1771 * 1754 1772 * @return bool $is_root_blog Returns true if this is bp_get_root_blog_id(). 1755 1773 */ … … 1830 1848 * 1831 1849 * @return bool False when multiblog mode is disabled; true when enabled. 1832 * Default: false.1850 * Default: false. 1833 1851 */ 1834 1852 function bp_is_multiblog_mode() { … … 1900 1918 * Set the "is_directory" global. 1901 1919 * 1902 * @param bool $is_directory Optional. Default: false.1903 * @param string $component Optional. Component name. Default: the current1904 * component.1920 * @param bool $is_directory Optional. Default: false. 1921 * @param string $component Optional. Component name. Default: the current 1922 * component. 1905 1923 */ 1906 1924 function bp_update_is_directory( $is_directory = false, $component = '' ) { … … 1924 1942 * Set the "is_item_admin" global. 1925 1943 * 1926 * @param bool $is_item_admin Optional. Default: false.1927 * @param string $component Optional. Component name. Default: the current1928 * component.1944 * @param bool $is_item_admin Optional. Default: false. 1945 * @param string $component Optional. Component name. Default: the current 1946 * component. 1929 1947 */ 1930 1948 function bp_update_is_item_admin( $is_item_admin = false, $component = '' ) { … … 1948 1966 * Set the "is_item_mod" global. 1949 1967 * 1950 * @param bool $is_item_mod Optional. Default: false.1951 * @param string $component Optional. Component name. Default: the current1952 * component.1968 * @param bool $is_item_mod Optional. Default: false. 1969 * @param string $component Optional. Component name. Default: the current 1970 * component. 1953 1971 */ 1954 1972 function bp_update_is_item_mod( $is_item_mod = false, $component = '' ) { … … 1976 1994 * @global WP_Query $wp_query WordPress query object. 1977 1995 * 1978 * @param string $redirect If 'remove_canonical_direct', remove WordPress' 1979 * "helpful"redirect_canonical action. Default: 'remove_canonical_redirect'.1996 * @param string $redirect If 'remove_canonical_direct', remove WordPress' "helpful" 1997 * redirect_canonical action. Default: 'remove_canonical_redirect'. 1980 1998 */ 1981 1999 function bp_do_404( $redirect = 'remove_canonical_direct' ) { … … 2012 2030 * @uses do_action() Calls 'bp_verify_nonce_request' on $action. 2013 2031 * 2014 * @param string $action Action nonce. 2015 * @param string $query_arg where to look for nonce in $_REQUEST. 2032 * @param string $action Action nonce. 2033 * @param string $query_arg Where to look for nonce in $_REQUEST. 2034 * 2016 2035 * @return bool True if the nonce is verified, otherwise false. 2017 2036 */ … … 2084 2103 2085 2104 /** 2086 * Return true|false if this is a POST request 2105 * Return true|false if this is a POST request. 2087 2106 * 2088 2107 * @since BuddyPress (1.9.0) … … 2094 2113 2095 2114 /** 2096 * Return true|false if this is a GET request 2115 * Return true|false if this is a GET request. 2097 2116 * 2098 2117 * @since BuddyPress (1.9.0) … … 2414 2433 * 2415 2434 * @param string $slug The slug of the nav item: login, register, or one of the 2416 * slugs from buddypress()->bp_nav. 2435 * slugs from buddypress()->bp_nav. 2436 * 2417 2437 * @return string $nav_item_url The URL generated for the current user. 2418 2438 */ … … 2436 2456 * for similar kinds of future requirements, or those implemented by third-party developers. 2437 2457 * 2458 * @since BuddyPress (2.1.0) 2459 * 2438 2460 * @param array $args 2461 * 2439 2462 * @return array|WP_Error Array of results. If there were any problems, returns a WP_Error object. 2440 * @since BuddyPress (2.1.0)2441 2463 */ 2442 2464 function bp_core_get_suggestions( $args ) {
Note: See TracChangeset
for help on using the changeset viewer.