Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/09/2015 05:07:56 AM (9 years ago)
Author:
tw2113
Message:

More updates to BP-Core docs.

See #6398.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-functions.php

    r10016 r10039  
    6565}
    6666    /**
    67      * Return the BuddyPress database version
     67     * Return the BuddyPress database version.
    6868     *
    6969     * @since BuddyPress (1.6)
     
    170170 * Format numbers the BuddyPress way.
    171171 *
    172  * @param int $number The number to be formatted.
     172 * @param int  $number  The number to be formatted.
    173173 * @param bool $decimals Whether to use decimals. See {@link number_format_i18n()}.
     174 *
    174175 * @return string The formatted number.
    175176 */
     
    224225 *
    225226 * @since BuddyPress (1.6)
     227 *
    226228 * @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 *
    228231 * @return array $new_args The parsed arguments.
    229232 */
     
    251254 * @since BuddyPress (r7704)
    252255 *
    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 *
    256260 * @return array Merged user defined values with defaults.
    257261 */
     
    313317 * @since BuddyPress (2.2.0)
    314318 *
    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.
    318323 */
    319324function bp_sanitize_pagination_arg( $page_arg = '', $page = 1 ) {
     
    344349 *
    345350 * @param string $order The 'order' string, as passed to the SQL constructor.
     351 *
    346352 * @return string The sanitized value 'DESC' or 'ASC'.
    347353 */
     
    364370 *
    365371 * @param string $text The raw text to be escaped.
     372 *
    366373 * @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.
    368375 */
    369376function bp_esc_like( $text ) {
     
    386393 *
    387394 * @return bool False when compatibility mode is disabled, true when enabled.
    388  *         Default: false.
     395 *              Default: false.
    389396 */
    390397function bp_is_username_compatibility_mode() {
     
    475482 *                       pages. When running save routines, use 'all' to avoid removing data related to inactive
    476483 *                       components. Default: 'active'.
     484 *
    477485 * @return array|string An array of page IDs, keyed by component names, or an
    478486 *                      empty string if the list is not found.
     
    526534 *
    527535 * @param array $blog_page_ids The IDs of the WP pages corresponding to BP
    528  *        component directories.
     536 *                             component directories.
    529537 */
    530538function bp_core_update_directory_page_ids( $blog_page_ids ) {
     
    608616 * @since BuddyPress (1.7.0)
    609617 *
    610  * @param array $components Components to create pages for.
    611  * @param string $existing 'delete' if you want to delete existing page
    612  *        mappings and replace with new ones. Otherwise existing page mappings
    613  *        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'.
    614622 */
    615623function bp_core_add_page_mappings( $components, $existing = 'keep' ) {
     
    749757 *
    750758 * @param string $root_slug The root slug, which comes from $bp->pages->[component]->slug.
     759 *
    751760 * @return string The short slug for use in the middle of URLs.
    752761 */
     
    914923 *
    915924 * @param string $location The redirect URL.
    916  * @param int $status Optional. The numeric code to give in the redirect
    917  *        headers. Default: 302.
     925 * @param int    $status  Optional. The numeric code to give in the redirect
     926 *                         headers. Default: 302.
    918927 */
    919928function bp_core_redirect( $location = '', $status = 302 ) {
     
    10061015 * @since BuddyPress (1.2.6)
    10071016 *
    1008  * @param bool $gmt True to use GMT (rather than local) time. Default: true.
     1017 * @param bool   $gmt True to use GMT (rather than local) time. Default: true.
    10091018 * @param string $type See the 'type' parameter in {@link current_time()}.
    1010           Default: 'mysql'.
     1019 *                     Default: 'mysql'.
     1020 *
    10111021 * @return string Current time in 'Y-m-d h:i:s' format.
    10121022 */
     
    10421052 *
    10431053 * @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 *
    10481059 * @return string String representing the time since the older date, eg
    10491060 *         "2 hours and 50 minutes".
     
    12381249 *
    12391250 * @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'.
    12421253 */
    12431254function bp_core_add_message( $message, $type = '' ) {
     
    14131424 *
    14141425 * @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 *
    14161428 * @return string $last_active A string of the form '3 years ago'.
    14171429 */
     
    14631475 *
    14641476 * @param string|bool $key The usermeta meta_key.
     1477 *
    14651478 * @return string $key The usermeta meta_key.
    14661479 */
     
    14891502 * @uses bp_get_user_meta_key() For a filterable version of the meta key.
    14901503 *
    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 *
    14941508 * @return mixed Will be an array if $single is false. Will be value of meta data field if $single
    14951509 *         is true.
     
    15111525 * @uses bp_get_user_meta_key() For a filterable version of the meta key.
    15121526 *
    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 *
    15171532 * @return bool False on failure, true on success.
    15181533 */
     
    15331548 * @uses bp_get_user_meta_key() For a filterable version of the meta key.
    15341549 *
    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 *
    15381554 * @return bool False for failure. True for success.
    15391555 */
     
    15661582 *
    15671583 * @return bool False when activity embed support is disabled; true when
    1568  *         enabled. Default: true.
     1584 *              enabled. Default: true.
    15691585 */
    15701586function bp_use_embed_in_activity() {
     
    15861602 *
    15871603 * @return bool False when activity replies embed support is disabled; true
    1588  *         when enabled. Default: true.
     1604 *              when enabled. Default: true.
    15891605 */
    15901606function bp_use_embed_in_activity_replies() {
     
    16061622 *
    16071623 * @return bool False when forum post embed support is disabled; true when
    1608  *         enabled. Default: true.
     1624 *              enabled. Default: true.
    16091625 */
    16101626function bp_use_embed_in_forum_posts() {
     
    16261642 *
    16271643 * @return bool False when private message embed support is disabled; true when
    1628  *         enabled. Default: true.
     1644 *              enabled. Default: true.
    16291645 */
    16301646function bp_use_embed_in_private_messages() {
     
    16491665 * @see bp_get_admin_url() For description of parameters.
    16501666 *
    1651  * @param string $path See {@link bp_get_admin_url()}.
     1667 * @param string $path   See {@link bp_get_admin_url()}.
    16521668 * @param string $scheme See {@link bp_get_admin_url()}.
    16531669 */
     
    16641680     * @uses admin_url()
    16651681     *
    1666      * @param string $path Optional. The sub-path under /wp-admin to be
    1667      *        appended to the admin URL.
     1682     * @param string $path   Optional. The sub-path under /wp-admin to be
     1683     *                       appended to the admin URL.
    16681684     * @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     *
    16711688     * @return string Admin url link with optional path appended.
    16721689     */
     
    16981715 *
    16991716 * @return bool True if the BP admin screen should appear in the Network Admin,
    1700  *         otherwise false.
     1717 *              otherwise false.
    17011718 */
    17021719function bp_core_do_network_admin() {
     
    17521769 *
    17531770 * @param int $blog_id Optional. Default: the ID of the current blog.
     1771 *
    17541772 * @return bool $is_root_blog Returns true if this is bp_get_root_blog_id().
    17551773 */
     
    18301848 *
    18311849 * @return bool False when multiblog mode is disabled; true when enabled.
    1832  *         Default: false.
     1850 *              Default: false.
    18331851 */
    18341852function bp_is_multiblog_mode() {
     
    19001918 * Set the "is_directory" global.
    19011919 *
    1902  * @param bool $is_directory Optional. Default: false.
    1903  * @param string $component Optional. Component name. Default: the current
    1904  *        component.
     1920 * @param bool   $is_directory Optional. Default: false.
     1921 * @param string $component    Optional. Component name. Default: the current
     1922 *                             component.
    19051923 */
    19061924function bp_update_is_directory( $is_directory = false, $component = '' ) {
     
    19241942 * Set the "is_item_admin" global.
    19251943 *
    1926  * @param bool $is_item_admin Optional. Default: false.
    1927  * @param string $component Optional. Component name. Default: the current
    1928  *        component.
     1944 * @param bool   $is_item_admin Optional. Default: false.
     1945 * @param string $component     Optional. Component name. Default: the current
     1946 *                              component.
    19291947 */
    19301948function bp_update_is_item_admin( $is_item_admin = false, $component = '' ) {
     
    19481966 * Set the "is_item_mod" global.
    19491967 *
    1950  * @param bool $is_item_mod Optional. Default: false.
    1951  * @param string $component Optional. Component name. Default: the current
    1952  *        component.
     1968 * @param bool   $is_item_mod Optional. Default: false.
     1969 * @param string $component   Optional. Component name. Default: the current
     1970 *                            component.
    19531971 */
    19541972function bp_update_is_item_mod( $is_item_mod = false, $component = '' ) {
     
    19761994 * @global WP_Query $wp_query WordPress query object.
    19771995 *
    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'.
    19801998 */
    19811999function bp_do_404( $redirect = 'remove_canonical_direct' ) {
     
    20122030 * @uses do_action() Calls 'bp_verify_nonce_request' on $action.
    20132031 *
    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 *
    20162035 * @return bool True if the nonce is verified, otherwise false.
    20172036 */
     
    20842103
    20852104/**
    2086  * Return true|false if this is a POST request
     2105 * Return true|false if this is a POST request.
    20872106 *
    20882107 * @since BuddyPress (1.9.0)
     
    20942113
    20952114/**
    2096  * Return true|false if this is a GET request
     2115 * Return true|false if this is a GET request.
    20972116 *
    20982117 * @since BuddyPress (1.9.0)
     
    24142433 *
    24152434 * @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 *
    24172437 * @return string $nav_item_url The URL generated for the current user.
    24182438 */
     
    24362456 * for similar kinds of future requirements, or those implemented by third-party developers.
    24372457 *
     2458 * @since BuddyPress (2.1.0)
     2459 *
    24382460 * @param array $args
     2461 *
    24392462 * @return array|WP_Error Array of results. If there were any problems, returns a WP_Error object.
    2440  * @since BuddyPress (2.1.0)
    24412463 */
    24422464function bp_core_get_suggestions( $args ) {
Note: See TracChangeset for help on using the changeset viewer.