Skip to:
Content

BuddyPress.org

Changeset 10497


Ignore:
Timestamp:
02/03/2016 05:01:13 AM (5 years ago)
Author:
tw2113
Message:

Adds many missing @since tags to the BP Core component.

See #6398.

Location:
trunk/src/bp-core
Files:
20 edited

Legend:

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

    r10492 r10497  
    1616 * Load BuddyPress plugin admin area.
    1717 *
    18  * @package BuddyPress
    19  * @subpackage CoreAdministration
    2018 * @todo Break this apart into each applicable Component.
    2119 *
     
    2927     * Path to the BuddyPress admin directory.
    3028     *
     29     * @since 1.6.0
    3130     * @var string $admin_dir
    3231     */
     
    3837     * URL to the BuddyPress admin directory.
    3938     *
     39     * @since 1.6.0
    4040     * @var string $admin_url
    4141     */
     
    4545     * URL to the BuddyPress images directory.
    4646     *
     47     * @since 1.6.0
    4748     * @var string $images_url
    4849     */
     
    5253     * URL to the BuddyPress admin CSS directory.
    5354     *
     55     * @since 1.6.0
    5456     * @var string $css_url
    5557     */
     
    5961     * URL to the BuddyPress admin JS directory.
    6062     *
     63     * @since 1.6.0
    6164     * @var string
    6265     */
     
    6871     * Notices used for user feedback, like saving settings.
    6972     *
     73     * @since 1.9.0
    7074     * @var array()
    7175     */
     
    931935         */
    932936        $styles = apply_filters( 'bp_core_admin_register_styles', array(
    933             // Legacy
     937            // Legacy.
    934938            'bp-admin-common-css' => array(
    935939                'file'         => $common_css,
  • trunk/src/bp-core/bp-core-attachments.php

    r10425 r10497  
    4444        $upload_data = bp_upload_dir();
    4545
    46         // Return empty string, if Uploads data are not available
     46        // Return empty string, if Uploads data are not available.
    4747        if ( ! $upload_data ) {
    4848            return $retval;
     
    584584 * Enqueues the script needed for the Uploader UI.
    585585 *
     586 * @since 2.3.0
     587 *
    586588 * @see BP_Attachment::script_data() && BP_Attachment_Avatar::script_data() for examples showing how
    587589 * to set specific script data.
    588  *
    589  * @since 2.3.0
    590590 *
    591591 * @param string $class Name of the class extending BP_Attachment (eg: BP_Attachment_Avatar).
     
    10651065 * @since 2.4.0
    10661066 *
    1067  * @param array                     $args {
     1067 * @param array                          $args {
    10681068 *     @type string $file            The absolute path to the image. Required.
    10691069 *     @type string $component       The component for the object (eg: groups, xprofile). Required.
  • trunk/src/bp-core/bp-core-avatars.php

    r10496 r10497  
    1313/**
    1414 * Set up the constants we need for avatar support.
     15 *
     16 * @since 1.2.0
    1517 */
    1618function bp_core_set_avatar_constants() {
     
    105107 *    add_filter( 'bp_core_fetch_avatar_no_grav', '__return_true' );
    106108 *
     109 * @since 1.1.0
    107110 * @since 2.4.0 Added 'extra_attr', 'scheme', 'rating' and 'force_default' for $args.
    108111 *              These are inherited from WordPress 4.2.0. See {@link get_avatar()}.
     
    634637            $url_args['r'] = strtolower( $params['rating'] );
    635638        }
    636         // Only set default image if 'Gravatar Logo' is not requested
     639        // Only set default image if 'Gravatar Logo' is not requested.
    637640        if ( 'gravatar_default' !== $default_grav ) {
    638641            $url_args['d'] = $default_grav;
     
    674677/**
    675678 * Delete an existing avatar.
     679 *
     680 * @since 1.1.0
    676681 *
    677682 * @param array|string $args {
     
    819824 * location.
    820825 *
     826 * @since 1.1.0
     827 *
    821828 * @see bp_core_check_avatar_upload()
    822829 * @see bp_core_check_avatar_type()
     
    11171124 *  crop_x - The horizontal starting point of the crop
    11181125 *  crop_y - The vertical starting point of the crop
     1126 *
     1127 * @since 1.1.0
    11191128 *
    11201129 * @param array|string $args {
     
    13181327 * See 'get_avatar' filter description in wp-includes/pluggable.php.
    13191328 *
     1329 * @since 1.1.0
    13201330 * @since 2.4.0 Added $args parameter to coincide with WordPress 4.2.0.
    13211331 *
     
    14141424 * Is the current avatar upload error-free?
    14151425 *
     1426 * @since 1.0.0
     1427 *
    14161428 * @param array $file The $_FILES array.
    14171429 * @return bool True if no errors are found. False if there are errors.
     
    14261438/**
    14271439 * Is the file size of the current avatar upload permitted?
     1440 *
     1441 * @since 1.0.0
    14281442 *
    14291443 * @param array $file The $_FILES array.
     
    14781492 *
    14791493 * Permitted file types are JPG, GIF and PNG.
     1494 *
     1495 * @since 1.0.0
    14801496 *
    14811497 * @param array $file The $_FILES array.
     
    15661582 * Get the absolute upload path for the WP installation.
    15671583 *
     1584 * @since 1.2.0
     1585 *
    15681586 * @uses bp_core_get_upload_dir() To get upload directory info.
    15691587 *
     
    15841602/**
    15851603 * Get the raw base URL for root site upload location.
     1604 *
     1605 * @since 1.2.0
    15861606 *
    15871607 * @uses bp_core_get_upload_dir() To get upload directory info.
     
    18501870 * @since  2.2.0
    18511871 *
    1852  * @param  WP_Query|null $posts_query the main query object.
    1853  *
    18541872 * @uses   bp_is_group_create()
    18551873 * @uses   bp_is_group_admin_page()
     
    18571875 * @uses   bp_action_variable() to check for the group's avatar creation step
    18581876 * @uses   bp_is_user_change_avatar() to check for the user's change profile screen
     1877 *
     1878 * @param WP_Query|null $posts_query The main query object.
    18591879 */
    18601880function bp_core_avatar_reset_query( $posts_query = null ) {
     
    19341954 * @global $is_safari
    19351955 * @global $is_IE
     1956 *
    19361957 * @return bool True to load the Webcam Avatar UI part. False otherwise.
    19371958 */
  • trunk/src/bp-core/bp-core-buddybar.php

    r10487 r10497  
    1515/**
    1616 * Add an item to the main BuddyPress navigation array.
     17 *
     18 * @since 1.1.0
    1719 *
    1820 * @param array|string $args {
     
    270272 * Modify the default subnav item that loads when a top level nav item is clicked.
    271273 *
     274 * @since 1.1.0
     275 *
    272276 * @param array|string $args {
    273277 *     @type string   $parent_slug     The slug of the nav item whose default is being changed.
     
    340344 * The sorting is split into a separate function because it can only happen
    341345 * after all plugins have had a chance to register their navigation items.
     346 *
     347 * @since 1.0.0
    342348 *
    343349 * @return bool|null Returns false on failure.
     
    373379/**
    374380 * Add a subnav item to the BuddyPress navigation.
     381 *
     382 * @since 1.1.0
    375383 *
    376384 * @param array|string $args {
     
    419427/**
    420428 * Add a subnav link to the BuddyPress navigation.
     429 *
     430 * @since 2.4.0
    421431 *
    422432 * @param array|string $args {
     
    507517 * Register a screen function, whether or not a related subnav link exists.
    508518 *
     519 * @since 2.4.0
     520 *
    509521 * @param array|string $args {
    510522 *     Array describing the new subnav item.
     
    682694 * Sort all subnavigation arrays.
    683695 *
     696 * @since 1.1.0
     697 *
    684698 * @return bool|null Returns false on failure.
    685699 */
     
    745759 * Remove a nav item from the navigation array.
    746760 *
     761 * @since 1.0.0
     762 *
    747763 * @param int $parent_id The slug of the parent navigation item.
    748764 * @return bool Returns false on failure, ie if the nav item can't be found.
     
    774790 * Remove a subnav item from the navigation array.
    775791 *
     792 * @since 1.0.0
     793 *
    776794 * @param string $parent_id The slug of the parent navigation item.
    777795 * @param string $slug      The slug of the subnav item to be removed.
     
    800818 * Clear all subnav items from a specific nav item.
    801819 *
     820 * @since 1.0.0
     821 *
    802822 * @param string $parent_slug The slug of the parent navigation item.
    803823 */
  • trunk/src/bp-core/bp-core-cache.php

    r10417 r10497  
    1717 * Prune the WP Super Cache.
    1818 *
     19 * When WP Super Cache is installed, this function will clear cached pages
     20 * so that success/error messages or time-sensitive content are not cached.
     21 *
     22 * @since 1.0.0
     23 *
    1924 * @see prune_super_cache()
    20  *
    21  * When wp-super-cache is installed this function will clear cached pages
    22  * so that success/error messages are not cached, or time sensitive content.
    2325 *
    2426 * @return int
     
    4244 * Clear all cached objects for a user, or those that a user is part of.
    4345 *
     46 * @since 1.0.0
     47 *
    4448 * @param string $user_id User ID to delete cache for.
    4549 */
     
    5054/**
    5155 * Clear member count caches and transients.
     56 *
     57 * @since 1.6.0
    5258 */
    5359function bp_core_clear_member_count_caches() {
  • trunk/src/bp-core/bp-core-caps.php

    r10417 r10497  
    335335 * Plugin authors: Please do not use this function; thank you. :)
    336336 *
     337 * @since 1.6.0
     338 *
    337339 * @access private
    338  * @since 1.6.0
    339340 *
    340341 * @see WP_User::has_cap()
  • trunk/src/bp-core/bp-core-catchuri.php

    r10487 r10497  
    2525 *   - OUTSIDE ROOT: http:// example.com / sites / buddypress / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ...
    2626 *
    27  *  Example:
     27 * Example:
    2828 *    - http://example.com/members/andy/profile/edit/group/5/
    2929 *    - $bp->current_component: string 'xprofile'
     
    7878    }
    7979
    80     // If running off blog other than root, any subdirectory names must be
    81     // removed from $bp_uri. This includes two cases:
    82     //
    83     // 1. when WP is installed in a subdirectory,
    84     // 2. when BP is running on secondary blog of a subdirectory
    85     // multisite installation. Phew!
     80    /*
     81     * If running off blog other than root, any subdirectory names must be
     82     * removed from $bp_uri. This includes two cases:
     83     *
     84     * 1. when WP is installed in a subdirectory,
     85     * 2. when BP is running on secondary blog of a subdirectory
     86     * multisite installation. Phew!
     87     */
    8688    if ( is_multisite() && !is_subdomain_install() && ( bp_is_multiblog_mode() || 1 != bp_get_root_blog_id() ) ) {
    8789
     
    131133    $bp_uri = array_merge( array(), $bp_uri );
    132134
    133     // If a component is set to the front page, force its name into $bp_uri
    134     // so that $current_component is populated (unless a specific WP post is being requested
    135     // via a URL parameter, usually signifying Preview mode).
     135    /*
     136     * If a component is set to the front page, force its name into $bp_uri
     137     * so that $current_component is populated (unless a specific WP post is being requested
     138     * via a URL parameter, usually signifying Preview mode).
     139     */
    136140    if ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_on_front' ) && empty( $bp_uri ) && empty( $_GET['p'] ) && empty( $_GET['page_id'] ) ) {
    137141        $post = get_post( get_option( 'page_on_front' ) );
     
    391395 *   wp-content/themes/[activated_theme]/members/index.php
    392396 *
     397 * @since 1.0.0
     398 *
    393399 * @param array $templates Array of templates to attempt to load.
    394400 */
     
    494500/**
    495501 * Redirect away from /profile URIs if XProfile is not enabled.
     502 *
     503 * @since 1.0.0
    496504 */
    497505function bp_core_catch_profile_uri() {
  • trunk/src/bp-core/bp-core-component.php

    r10417 r10497  
    3838     * Unique ID for the component.
    3939     *
     40     * @since 1.5.0
    4041     * @var string $id
    4142     */
     
    4546     * Unique slug for the component, for use in query strings and URLs.
    4647     *
     48     * @since 1.5.0
    4749     * @var string $slug
    4850     */
     
    5254     * Does the component need a top-level directory?
    5355     *
     56     * @since 1.5.0
    5457     * @var bool $has_directory
    5558     */
     
    5962     * The path to the component's files.
    6063     *
     64     * @since 1.5.0
    6165     * @var string $path
    6266     */
     
    6670     * The WP_Query loop for this component.
    6771     *
     72     * @since 1.5.0
    6873     * @var WP_Query $query
    6974     */
     
    7378     * The current ID of the queried object.
    7479     *
     80     * @since 1.5.0
    7581     * @var string $current_id
    7682     */
     
    8086     * Callback for formatting notifications.
    8187     *
     88     * @since 1.5.0
    8289     * @var callable $notification_callback
    8390     */
     
    8794     * WordPress Toolbar links.
    8895     *
     96     * @since 1.5.0
    8997     * @var array $admin_menu
    9098     */
     
    94102     * Placeholder text for component directory search box.
    95103     *
    96      * @since 1.5.0
     104     * @since 1.6.0
    97105     * @var string $search_string
    98106     */
     
    102110     * Root slug for the component.
    103111     *
    104      * @since 1.5.0
     112     * @since 1.6.0
    105113     * @var string $root_slug
    106114     */
     
    465473     * Set up component navigation.
    466474     *
     475     * @since 1.5.0
     476     *
    467477     * @see bp_core_new_nav_item() For a description of the $main_nav
    468478     *      parameter formatting.
     
    503513     * Set up the component entries in the WordPress Admin Bar.
    504514     *
     515     * @since 1.5.0
     516     *
    505517     * @see WP_Admin_Bar::add_menu() for a description of the syntax
    506518     *      required by each item in the $wp_admin_nav parameter array.
  • trunk/src/bp-core/bp-core-cssjs.php

    r10417 r10497  
    108108/**
    109109 * Load the JS for "Are you sure?" .confirm links.
     110 *
     111 * @since 1.1.0
    110112 */
    111113function bp_core_confirmation_js() {
     
    161163/**
    162164 * Enqueues jCrop library and hooks BP's custom cropper JS.
     165 *
     166 * @since 1.1.0
    163167 */
    164168function bp_core_add_jquery_cropper() {
     
    171175/**
    172176 * Output the inline JS needed for the cropper to work on a per-page basis.
     177 *
     178 * @since 1.1.0
    173179 */
    174180function bp_core_add_cropper_inline_js() {
     
    273279/**
    274280 * Output the inline CSS for the BP image cropper.
     281 *
     282 * @since 1.1.0
    275283 */
    276284function bp_core_add_cropper_inline_css() {
  • trunk/src/bp-core/bp-core-dependency.php

    r10431 r10497  
    2323/**
    2424 * Fire the 'bp_include' action, where plugins should include files.
     25 *
     26 * @since 1.2.5
    2527 */
    2628function bp_include() {
     
    3638/**
    3739 * Fire the 'bp_setup_components' action, where plugins should initialize components.
     40 *
     41 * @since 1.6.0
    3842 */
    3943function bp_setup_components() {
     
    4953/**
    5054 * Fire the 'bp_setup_canonical_stack' action, where plugins should set up their canonical URL.
     55 *
     56 * @since 2.1.0
    5157 */
    5258function bp_setup_canonical_stack() {
     
    9298/**
    9399 * Fire the 'bp_setup_globals' action, where plugins should initialize global settings.
     100 *
     101 * @since 1.2.0
    94102 */
    95103function bp_setup_globals() {
     
    105113/**
    106114 * Fire the 'bp_setup_nav' action, where plugins should register their navigation items.
     115 *
     116 * @since 1.2.0
    107117 */
    108118function bp_setup_nav() {
     
    118128/**
    119129 * Fire the 'bp_setup_admin_bar' action, where plugins should add items to the WP admin bar.
     130 *
     131 * @since 1.5.0
    120132 */
    121133function bp_setup_admin_bar() {
     
    135147/**
    136148 * Fire the 'bp_setup_title' action, where plugins should modify the page title.
     149 *
     150 * @since 1.5.0
    137151 */
    138152function bp_setup_title() {
     
    148162/**
    149163 * Fire the 'bp_register_widgets' action, where plugins should register widgets.
     164 *
     165 * @since 1.2.0
    150166 */
    151167function bp_setup_widgets() {
     
    193209 *
    194210 * We white-list the WordPress customizer which purposely loads the user early.
     211 *
     212 * @since 1.7.0
    195213 *
    196214 * @link https://buddypress.trac.wordpress.org/ticket/6046
     
    218236/**
    219237 * Fire the 'bp_init' action, BuddyPress's main initialization hook.
     238 *
     239 * @since 1.2.5
    220240 */
    221241function bp_init() {
     
    253273 *
    254274 * Attached to 'plugins_loaded'.
     275 *
     276 * @since 1.2.0
    255277 */
    256278function bp_loaded() {
     
    268290 *
    269291 * Attached to 'wp'.
     292 *
     293 * @since 1.6.0
    270294 */
    271295function bp_ready() {
     
    284308 * Attach potential template actions, such as catching form requests or routing
    285309 * custom URLs.
     310 *
     311 * @since 1.5.0
    286312 */
    287313function bp_actions() {
     
    300326 * Runs just after 'bp_actions'. Use this hook to attach your template
    301327 * loaders.
     328 *
     329 * @since 1.5.0
    302330 */
    303331function bp_screens() {
     
    317345 *
    318346 * Hooked to 'widgets_init'.
     347 *
     348 * @since 1.6.0
    319349 */
    320350function bp_widgets_init() {
     
    334364 *
    335365 * Hooked to 'wp_head'.
     366 *
     367 * @since 1.6.0
    336368 */
    337369function bp_head() {
     370
     371    /**
     372     * Fires inside the 'bp_head' function, which runs on 'wp_head'.
     373     *
     374     * @since 1.6.0
     375     */
    338376    do_action ( 'bp_head' );
    339377}
  • trunk/src/bp-core/bp-core-filters.php

    r10479 r10497  
    8080 * Prevent specific pages (eg 'Activate') from showing on page listings.
    8181 *
     82 * @since 1.5.0
     83 *
    8284 * @uses bp_is_active() checks if a BuddyPress component is active.
    8385 *
     
    243245
    244246/**
     247 * Set "From" name in outgoing email to the site name.
     248 *
     249 * @since 1.0.0
     250 *
     251 * @uses bp_get_option() fetches the value for a meta_key in the wp_X_options table.
     252 *
     253 * @return string The blog name for the root blog.
     254 */
     255function bp_core_email_from_name_filter() {
     256
     257    /**
     258     * Filters the "From" name in outgoing email to the site name.
     259     *
     260     * @since 1.2.0
     261     *
     262     * @param string $value Value to set the "From" name to.
     263     */
     264    return apply_filters( 'bp_core_email_from_name_filter', bp_get_option( 'blogname', 'WordPress' ) );
     265}
     266add_filter( 'wp_mail_from_name', 'bp_core_email_from_name_filter' );
     267
     268/**
    245269 * Filter the blog post comments array and insert BuddyPress URLs for users.
     270 *
     271 * @since 1.2.0
    246272 *
    247273 * @param array $comments The array of comments supplied to the comments template.
     
    281307/**
    282308 * When a user logs in, redirect him in a logical way.
     309 *
     310 * @since 1.2.0
    283311 *
    284312 * @uses apply_filters() Filter 'bp_core_login_redirect' to modify where users
     
    352380 * This filter will not fire when a user is registered by the site admin.
    353381 *
     382 * @since 1.2.1
     383 *
    354384 * @param string $welcome_email Complete email passed through WordPress.
    355385 * @return string Filtered $welcome_email with the password replaced
     
    385415 *
    386416 * This filter will not fire when a user is registered by the site admin.
     417 *
     418 * @since 1.2.1
    387419 *
    388420 * @param string $welcome_email Complete email passed through WordPress.
     
    413445 * This function filter's WP's 'wpmu_signup_blog_notification', and replaces
    414446 * WP's default welcome email with a BuddyPress-specific message.
     447 *
     448 * @since 1.0.0
     449 *
     450 * @see wpmu_signup_blog_notification() for a description of parameters.
    415451 *
    416452 * @param string $domain     The new blog domain.
     
    444480 * Notify new users of a successful registration (without blog).
    445481 *
     482 * @since 1.0.0
     483 *
    446484 * @see wpmu_signup_user_notification() for a full description of params.
    447485 *
     
    510548    global $paged, $page, $_wp_theme_features;
    511549
    512     // Get the BuddyPress title parts
     550    // Get the BuddyPress title parts.
    513551    $bp_title_parts = bp_get_title_parts( $seplocation );
    514552
    515     // If not set, simply return the original title
     553    // If not set, simply return the original title.
    516554    if ( ! $bp_title_parts ) {
    517555        return $title;
     
    529567    $title_tag_compatibility = (bool) ( ! empty( $_wp_theme_features['title-tag'] ) || strstr( $title, $blogname ) );
    530568
    531     // Append the site title to title parts if theme supports title tag
     569    // Append the site title to title parts if theme supports title tag.
    532570    if ( true === $title_tag_compatibility ) {
    533571        $bp_title_parts['site'] = $blogname;
     
    538576    }
    539577
    540     // Pad the separator with 1 space on each side
     578    // Pad the separator with 1 space on each side.
    541579    $prefix = str_pad( $sep, strlen( $sep ) + 2, ' ', STR_PAD_BOTH );
    542580
    543     // Join the parts together
     581    // Join the parts together.
    544582    $new_title = join( $prefix, array_filter( $bp_title_parts ) );
    545583
    546     // Append the prefix for pre `title-tag` compatibility
     584    // Append the prefix for pre `title-tag` compatibility.
    547585    if ( false === $title_tag_compatibility ) {
    548586        $new_title = $new_title . $prefix;
     
    571609 * @since 2.4.3
    572610 *
    573  * @param array $title The WordPress document title parts
     611 * @param array $title The WordPress document title parts.
    574612 * @return array the unchanged title parts or the BuddyPress ones
    575613 */
    576614function bp_modify_document_title_parts( $title = array() ) {
    577     // Get the BuddyPress title parts
     615    // Get the BuddyPress title parts.
    578616    $bp_title_parts = bp_get_title_parts();
    579617
    580     // If not set, simply return the original title
     618    // If not set, simply return the original title.
    581619    if ( ! $bp_title_parts ) {
    582620        return $title;
    583621    }
    584622
    585     // Get the separator used by wp_get_document_title()
     623    // Get the separator used by wp_get_document_title().
    586624    $sep = apply_filters( 'document_title_separator', '-' );
    587625
  • trunk/src/bp-core/bp-core-functions.php

    r10491 r10497  
    8383 *
    8484 * The filter is intended primarily for use in multinetwork installations.
     85 *
     86 * @since 1.2.6
    8587 *
    8688 * @global object $wpdb WordPress database object.
     
    171173 * Format numbers the BuddyPress way.
    172174 *
     175 * @since 1.2.0
     176 *
    173177 * @param int  $number   The number to be formatted.
    174178 * @param bool $decimals Whether to use decimals. See {@link number_format_i18n()}.
     
    251255 * are applied.
    252256 *
    253  * @since r7704
     257 * @since 2.0.0
    254258 *
    255259 * @param string|array $args       Value to merge with $defaults.
     
    777781 * with the new method.
    778782 *
     783 * @since 1.0.0
     784 *
    779785 * @param string $slug The slug of the component being added to the root list.
    780786 */
     
    816822/**
    817823 * Create WordPress pages to be used as BP component directories.
     824 *
     825 * @since 1.5.0
    818826 */
    819827function bp_core_create_root_component_page() {
     
    842850 *
    843851 * For example, it would stop someone creating a blog with the slug "groups".
     852 *
     853 * @since 1.0.0
    844854 *
    845855 * @todo Deprecate?
     
    918928 * Eg: http://example.com OR https://example.com
    919929 *
     930 * @since 1.0.0
     931 *
    920932 * @uses get_blog_option() WordPress function to fetch blog meta.
    921933 *
     
    938950/**
    939951 * Perform a status-safe wp_redirect() that is compatible with BP's URI parser.
     952 *
     953 * @since 1.0.0
    940954 *
    941955 * @uses wp_safe_redirect()
     
    9881002/**
    9891003 * Get the path of the current site.
     1004 *
     1005 * @since 1.0.0
    9901006 *
    9911007 * @global object $current_site
     
    10651081 * an interval of 3 minutes will be represented by "3 minutes ago", as will an
    10661082 * interval of 3 minutes 59 seconds.
     1083 *
     1084 * @since 1.0.0
    10671085 *
    10681086 * @uses apply_filters() Filter 'bp_core_time_since_pre' to bypass BP's calculations.
     
    12651283 * Add a feedback (error/success) message to the WP cookie so it can be displayed after the page reloads.
    12661284 *
     1285 * @since 1.0.0
     1286 *
    12671287 * @param string $message Feedback message to be displayed.
    12681288 * @param string $type    Message type. 'updated', 'success', 'error', 'warning'.
     
    13011321 * so that the message is not shown to the user multiple times.
    13021322 *
     1323 * @since 1.1.0
     1324 *
    13031325 * @uses setcookie() Sets a cookie value for the user.
    13041326 */
     
    13331355 * The hook action 'template_notices' is used to call this function, it is not
    13341356 * called directly.
     1357 *
     1358 * @since 1.1.0
    13351359 */
    13361360function bp_core_render_message() {
     
    13811405 * site.
    13821406 *
     1407 * @since 1.0.0
     1408 *
    13831409 * @uses bp_update_user_meta() BP function to update user metadata in the
    13841410 *       usermeta table.
     
    14371463 * Format last activity string based on time since date given.
    14381464 *
     1465 * @since 1.0.0
     1466 *
    14391467 * @uses bp_core_time_since() This function will return an English
    14401468 *       representation of the time elapsed.
     
    17571785 *     add_action( bp_core_admin_hook(), 'myplugin_dashboard_panel_setup' );
    17581786 *
     1787 * @since 1.5.0
     1788 *
    17591789 * @return string $hook The proper hook ('network_admin_menu' or 'admin_menu').
    17601790 */
     
    19281958 * Set the "is_directory" global.
    19291959 *
     1960 * @since 1.5.0
     1961 *
    19301962 * @param bool   $is_directory Optional. Default: false.
    19311963 * @param string $component    Optional. Component name. Default: the current
     
    19521984 * Set the "is_item_admin" global.
    19531985 *
     1986 * @since 1.5.0
     1987 *
    19541988 * @param bool   $is_item_admin Optional. Default: false.
    19551989 * @param string $component     Optional. Component name. Default: the current
     
    19752009/**
    19762010 * Set the "is_item_mod" global.
     2011 *
     2012 * @since 1.5.0
    19772013 *
    19782014 * @param bool   $is_item_mod Optional. Default: false.
     
    21392175 * Load the buddypress translation file for current language.
    21402176 *
     2177 * @since 1.0.2
     2178 *
    21412179 * @see load_textdomain() for a description of return values.
    21422180 *
     
    21812219/**
    21822220 * A JavaScript-free implementation of the search functions in BuddyPress.
     2221 *
     2222 * @since 1.0.1
    21832223 *
    21842224 * @param string $slug The slug to redirect to for searching.
     
    22552295/**
    22562296 * Print the generation time in the footer of the site.
     2297 *
     2298 * @since 1.0.0
    22572299 */
    22582300function bp_core_print_generation_time() {
     
    26182660         * @since 2.5.0
    26192661         *
    2620          * @param string $post_type Email post type name.
     2662         * @param string $value Email post type name.
    26212663         */
    26222664        return apply_filters( 'bp_get_email_post_type', buddypress()->email_post_type );
     
    26372679     * @since 2.5.0
    26382680     *
    2639      * @param string[] $labels Associative array (name => label).
     2681     * @param array $value Associative array (name => label).
    26402682     */
    26412683    return apply_filters( 'bp_get_email_post_type_labels', array(
     
    26722714     * @since 2.5.0
    26732715     *
    2674      * @param string[] $features Supported features.
     2716     * @param array $value Supported features.
    26752717     */
    26762718    return apply_filters( 'bp_get_email_post_type_supports', array(
     
    27082750         * @since 2.5.0
    27092751         *
    2710          * @param string $taxonomy Email type taxonomy name.
     2752         * @param string $value Email type taxonomy name.
    27112753         */
    27122754        return apply_filters( 'bp_get_email_tax_type', buddypress()->email_taxonomy_type );
     
    27182760 * @since 2.5.0
    27192761 *
    2720  * @return string[]
     2762 * @return array
    27212763 */
    27222764function bp_get_email_tax_type_labels() {
     
    27272769     * @since 2.5.0
    27282770     *
    2729      * @param string[] $labels Associative array (name => label).
     2771     * @param array $value Associative array (name => label).
    27302772     */
    27312773    return apply_filters( 'bp_get_email_tax_type_labels', array(
     
    28132855     * @param string  $email_type Unique identifier for a particular type of email.
    28142856     * @param array   $args       Arguments used with get_posts() to fetch a post object.
    2815      * @param WP_Post[] All posts retrieved by get_posts( $args ). May only contain $post.
     2857     * @param WP_Post $post      All posts retrieved by get_posts( $args ). May only contain $post.
    28162858     */
    28172859    $post  = apply_filters( 'bp_get_email_post', $post[0], $email_type, $args, $post );
     
    28322874     *
    28332875     * @param BP_Email $email      An object representing a single email, ready for mailing.
    2834      * @param WP_Post  $post       Post object containing the contents of the email.
    28352876     * @param string   $email_type Unique identifier for a particular type of email.
    28362877     * @param array    $args       Arguments used with get_posts() to fetch a post object.
    2837      * @param WP_Post[] All posts retrieved by get_posts( $args ). May only contain $post.
     2878     * @param WP_Post  $post      All posts retrieved by get_posts( $args ). May only contain $post.
    28382879     */
    28392880    $retval = apply_filters( 'bp_get_email', $email, $email_type, $args, $post );
     
    28552896 * @since 2.5.0
    28562897 *
    2857  * @param string $email_type Type of email being sent.
    2858  * @param string|array|int|WP_User $to Either a email address, user ID, WP_User object,
    2859  *                                     or an array containing any combination of the above.
    2860  * @param array $args {
     2898 * @param string                   $email_type Type of email being sent.
     2899 * @param string|array|int|WP_User $to         Either a email address, user ID, WP_User object,
     2900 *                                             or an array containg the address and name.
     2901 * @param array                    $args {
    28612902 *     Optional. Array of extra. parameters.
    28622903 *
     
    28772918    }
    28782919
    2879     // wp_mail() is a pluggable function. Has it been re-defined by another plugin?
     2920    // Since wp_mail() is a pluggable function, has it been re-defined by another plugin?
    28802921    if ( is_null( $is_default_wpmail ) ) {
    28812922        try {
     
    29442985     * @since 2.5.0
    29452986     *
    2946      * @param string $deliver_class The email delivery class name.
    2947      * @param string $email_type Type of email being sent.
    2948      * @param string[]|string $to Array or comma-separated list of email addresses to the email to.
    2949      * @param array $args {
     2987     * @param string       $deliver_class The email delivery class name.
     2988     * @param string       $email_type    Type of email being sent.
     2989     * @param array|string $to            Array or comma-separated list of email addresses to the email to.
     2990     * @param array        $args {
    29502991     *     Optional. Array of extra parameters.
    29512992     *
     
    29623003
    29633004    if ( is_wp_error( $status ) ) {
     3005
    29643006        /**
    29653007         * Fires after BuddyPress has tried - and failed - to send an email.
     
    29693011         * @param WP_Error $status A WP_Error object describing why the email failed to send. The contents
    29703012         *                         will vary based on the email delivery class you are using.
    2971          * @param BP_Email $email The email we tried to send.
     3013         * @param BP_Email $email  The email we tried to send.
    29723014         */
    29733015        do_action( 'bp_send_email_failure', $status, $email );
    29743016
    29753017    } else {
     3018
    29763019        /**
    29773020         * Fires after BuddyPress has succesfully sent an email.
     
    29793022         * @since 2.5.0
    29803023         *
    2981          * @param bool $status True if the email was sent successfully.
    2982          * @param BP_Email $email The email sent.
     3024         * @param bool     $status True if the email was sent successfully.
     3025         * @param BP_Email $email  The email sent.
    29833026         */
    29843027        do_action( 'bp_send_email_success', $status, $email );
     
    30303073 *
    30313074 * @param WP_Post $object Post to get email template for.
    3032  * @return string[]
     3075 * @return array
    30333076 */
    30343077function bp_email_get_template( WP_Post $object ) {
     
    30403083     * @since 2.5.0
    30413084     *
    3042      * @param string[] $templates
     3085     * @param array   $value  Array of possible template paths.
     3086     * @param WP_Post $object WP_Post object.
    30433087     */
    30443088    return apply_filters( 'bp_email_get_template', array(
  • trunk/src/bp-core/bp-core-loader.php

    r10485 r10497  
    1515/**
    1616 * Creates the Core component.
     17 *
     18 * @since 1.5.0
    1719 */
    1820class BP_Core extends BP_Component {
     
    148150    /**
    149151     * Include bp-core files.
     152     *
     153     * @since 1.6.0
    150154     *
    151155     * @see BP_Component::includes() for description of parameters.
  • trunk/src/bp-core/bp-core-options.php

    r10417 r10497  
    335335 * This function is no longer used.
    336336 *
     337 * @since 1.2.4
    337338 * @deprecated 1.6.0
    338339 *
     
    371372 * settings are needed at run time. Instead of fetching them all and adding many
    372373 * initial queries to each page load, let's fetch them all in one go.
     374 *
     375 * @since 1.5.0
    373376 *
    374377 * @todo Use settings API and audit these methods.
  • trunk/src/bp-core/bp-core-template-loader.php

    r10425 r10497  
    188188 * an array of the template locations.
    189189 *
     190 * @since 1.7.0
     191 *
    190192 * @see bp_register_template_stack()
    191  *
    192  * @since 1.7.0
    193193 *
    194194 * @global array $wp_filter         Stores all of the filters.
  • trunk/src/bp-core/bp-core-template.php

    r10487 r10497  
    2424 * The function will also analyze the current action for the current component
    2525 * to determine whether or not to highlight a particular sub nav item.
     26 *
     27 * @since 1.0.0
    2628 *
    2729 * @uses bp_get_user_nav() Renders the navigation for a profile of a currently
     
    209211/**
    210212 * Output the current avatar upload step.
     213 *
     214 * @since 1.1.0
    211215 */
    212216function bp_avatar_admin_step() {
     
    215219    /**
    216220     * Return the current avatar upload step.
     221     *
     222     * @since 1.1.0
    217223     *
    218224     * @return string The current avatar upload step. Returns 'upload-image'
     
    237243/**
    238244 * Output the URL of the avatar to crop.
     245 *
     246 * @since 1.1.0
    239247 */
    240248function bp_avatar_to_crop() {
     
    243251    /**
    244252     * Return the URL of the avatar to crop.
     253     *
     254     * @since 1.1.0
    245255     *
    246256     * @return string URL of the avatar awaiting cropping.
     
    264274/**
    265275 * Output the relative file path to the avatar to crop.
     276 *
     277 * @since 1.1.0
    266278 */
    267279function bp_avatar_to_crop_src() {
     
    270282    /**
    271283     * Return the relative file path to the avatar to crop.
     284     *
     285     * @since 1.1.0
    272286     *
    273287     * @return string Relative file path to the avatar.
     
    304318/**
    305319 * Output the name of the BP site. Used in RSS headers.
     320 *
     321 * @since 1.0.0
    306322 */
    307323function bp_site_name() {
     
    416432 * do the necessary argument swapping for dynamic phrases.
    417433 *
     434 * @since 1.0.0
     435 *
    418436 * @param string $youtext    The "you" version of the phrase (eg "Your Friends").
    419437 * @param string $nametext   The other-user version of the phrase. Should be in
     
    479497/**
    480498 * Return the "action" attribute for search forms.
     499 *
     500 * @since 1.0.0
    481501 *
    482502 * @return string URL action attribute for search forms, eg example.com/search/.
     
    707727 * Create and output a button.
    708728 *
     729 * @since 1.2.6
     730 *
    709731 * @see bp_get_button()
    710732 *
     
    716738    /**
    717739     * Create and return a button.
     740     *
     741     * @since 1.2.6
    718742     *
    719743     * @see BP_Button for a description of arguments and return value.
     
    752776 * - `html` If true, HTML tags would be handled correctly.
    753777 * - `filter_shortcodes` If true, shortcodes will be stripped before truncating.
     778 *
     779 * @since 1.0.0
    754780 *
    755781 * @param string $text   String to truncate.
     
    963989/**
    964990 * Output the total member count for the site.
     991 *
     992 * @since 1.2.0
    965993 */
    966994function bp_total_member_count() {
     
    9781006     * which did not take into account last_activity, and thus often
    9791007     * resulted in higher counts than shown by member directory pagination.
     1008     *
     1009     * @since 1.2.0
    9801010     *
    9811011     * @return int Member count.
     
    10081038     * Network Admin > Settings.
    10091039     *
     1040     * @since 1.2.0
     1041     *
    10101042     * @return bool True if blog signup is allowed, otherwise false.
    10111043     */
     
    10261058/**
    10271059 * Check whether an activation has just been completed.
     1060 *
     1061 * @since 1.1.0
    10281062 *
    10291063 * @return bool True if the activation_complete global flag has been set,
     
    10451079 * activation. This filter exists so that customizations that omit activation
    10461080 * can remove certain notification text from the registration screen.
     1081 *
     1082 * @since 1.2.0
    10471083 *
    10481084 * @return bool True by default.
     
    11161152 * WordPress theme without coping the functions from functions.php.
    11171153 *
     1154 * @since 1.2.0
     1155 *
    11181156 * @param string|bool $object Current template component.
    11191157 * @return string The AJAX querystring.
     
    11431181/**
    11441182 * Return the name of the current component.
     1183 *
     1184 * @since 1.0.0
    11451185 *
    11461186 * @return string Component name.
     
    11651205 * Return the name of the current action.
    11661206 *
     1207 * @since 1.0.0
     1208 *
    11671209 * @return string Action name.
    11681210 */
     
    11861228 * Return the name of the current item.
    11871229 *
     1230 * @since 1.1.0
     1231 *
    11881232 * @return string|bool
    11891233 */
     
    12071251 * Return the value of $bp->action_variables.
    12081252 *
     1253 * @since 1.0.0
     1254 *
    12091255 * @return array|bool $action_variables The action variables array, or false
    12101256 *                                      if the array is empty.
     
    12541300/**
    12551301 * Output the "root domain", the URL of the BP root blog.
     1302 *
     1303 * @since 1.1.0
    12561304 */
    12571305function bp_root_domain() {
     
    12601308    /**
    12611309     * Return the "root domain", the URL of the BP root blog.
     1310     *
     1311     * @since 1.1.0
    12621312     *
    12631313     * @return string URL of the BP root blog.
     
    13941444}
    13951445
     1446/**
     1447 * Returns whether or not a user has access.
     1448 *
     1449 * @since 1.2.4
     1450 *
     1451 * @return bool
     1452 */
    13961453function bp_user_has_access() {
    13971454    $has_access = bp_current_user_can( 'bp_moderate' ) || bp_is_my_profile();
     
    14391496 * Get the ID of the currently displayed user.
    14401497 *
     1498 * @since 1.0.0
     1499 *
    14411500 * @uses apply_filters() Filter 'bp_displayed_user_id' to change this value.
    14421501 *
     
    14611520/**
    14621521 * Get the ID of the currently logged-in user.
     1522 *
     1523 * @since 1.0.0
    14631524 *
    14641525 * @uses apply_filters() Filter 'bp_loggedin_user_id' to change this value.
     
    16421703 * Check against the current_item.
    16431704 *
     1705 * @since 1.5.0
     1706 *
    16441707 * @param string $item The item being checked.
    16451708 * @return bool True if $item is the current item.
     
    16611724/**
    16621725 * Are we looking at a single item? (group, user, etc).
     1726 *
     1727 * @since 1.1.0
    16631728 *
    16641729 * @return bool True if looking at a single item, otherwise false.
     
    16851750 * Is the logged-in user an admin for the current item?
    16861751 *
     1752 * @since 1.5.0
     1753 *
    16871754 * @return bool True if the current user is an admin for the current item,
    16881755 *              otherwise false.
     
    17091776 * Is the logged-in user a mod for the current item?
    17101777 *
     1778 * @since 1.5.0
     1779 *
    17111780 * @return bool True if the current user is a mod for the current item,
    17121781 *              otherwise false.
     
    17331802 * Is this a component directory page?
    17341803 *
     1804 * @since 1.0.0
     1805 *
    17351806 * @return bool True if the current page is a component directory, otherwise false.
    17361807 */
     
    17611832 * This function is on the chopping block. It's currently only used by a few
    17621833 * already deprecated functions.
     1834 *
     1835 * @since 1.5.0
    17631836 *
    17641837 * @param string $component_name Component name to check.
     
    18481921 * You can tell if a page is displaying BP content by whether the
    18491922 * current_component has been defined.
     1923 *
     1924 * @since 1.0.0
    18501925 *
    18511926 * @return bool True if it's a non-BP page, false otherwise.
     
    19622037 * Check whether the current page is part of the Members component.
    19632038 *
     2039 * @since 1.5.0
     2040 *
    19642041 * @return bool True if the current page is part of the Members component.
    19652042 */
     
    19712048 * Check whether the current page is part of the Profile component.
    19722049 *
     2050 * @since 1.1.0
     2051 *
    19732052 * @return bool True if the current page is part of the Profile component.
    19742053 */
     
    19802059 * Check whether the current page is part of the Activity component.
    19812060 *
     2061 * @since 1.1.0
     2062 *
    19822063 * @return bool True if the current page is part of the Activity component.
    19832064 */
     
    19892070 * Check whether the current page is part of the Blogs component.
    19902071 *
     2072 * @since 1.1.0
     2073 *
    19912074 * @return bool True if the current page is part of the Blogs component.
    19922075 */
     
    19982081 * Check whether the current page is part of the Messages component.
    19992082 *
     2083 * @since 1.1.0
     2084 *
    20002085 * @return bool True if the current page is part of the Messages component.
    20012086 */
     
    20072092 * Check whether the current page is part of the Friends component.
    20082093 *
     2094 * @since 1.1.0
     2095 *
    20092096 * @return bool True if the current page is part of the Friends component.
    20102097 */
     
    20162103 * Check whether the current page is part of the Groups component.
    20172104 *
     2105 * @since 1.1.0
     2106 *
    20182107 * @return bool True if the current page is part of the Groups component.
    20192108 */
     
    20252114 * Check whether the current page is part of the Forums component.
    20262115 *
     2116 * @since 1.5.0
     2117 *
    20272118 * @return bool True if the current page is part of the Forums component.
    20282119 */
     
    20442135/**
    20452136 * Check whether the current page is part of the Settings component.
     2137 *
     2138 * @since 1.1.0
    20462139 *
    20472140 * @return bool True if the current page is part of the Settings component.
     
    20602153 * BuddyPress core, it will return true.
    20612154 *
     2155 * @since 1.7.0
     2156 *
    20622157 * @return bool True if the current component is active and is one of BP's
    20632158 *              packaged components.
     
    20962191 * Is the current page a single activity item permalink?
    20972192 *
     2193 * @since 1.5.0
     2194 *
    20982195 * @return bool True if the current page is a single activity item permalink.
    20992196 */
     
    21242221 * Will return true for any subpage of the logged-in user's profile, eg
    21252222 * http://example.com/members/joe/friends/.
     2223 *
     2224 * @since 1.2.0
    21262225 *
    21272226 * @return bool True if the current page is part of the profile of the logged-in user.
     
    21492248 * Will return true anytime there is a displayed user.
    21502249 *
     2250 * @since 1.5.0
     2251 *
    21512252 * @return bool True if the current page is a user page.
    21522253 */
     
    21602261 * Eg http://example.com/members/joe/activity/ (or any subpages thereof).
    21612262 *
     2263 * @since 1.1.0
     2264 *
    21622265 * @return bool True if the current page is a user's activity stream page.
    21632266 */
     
    21712274 * Eg http://example.com/members/joe/friends/
    21722275 *
     2276 * @since 1.1.0
     2277 *
    21732278 * @return bool True if the current page is a user's Friends activity stream.
    21742279 */
     
    21962301 *
    21972302 * Eg http://example.com/members/joe/groups/
     2303 *
     2304 * @since 1.5.0
    21982305 *
    21992306 * @return bool True if the current page is a user's Groups activity stream.
     
    22212328 * Eg http://example.com/members/joe/profile/ (or a subpage thereof).
    22222329 *
     2330 * @since 1.1.0
     2331 *
    22232332 * @return bool True if the current page is part of a user's extended profile.
    22242333 */
     
    22322341 * Eg http://example.com/members/joe/profile/edit/ (or a subpage thereof).
    22332342 *
     2343 * @since 1.5.0
     2344 *
    22342345 * @return bool True if the current page is a user's profile edit page.
    22352346 */
     
    22382349}
    22392350
     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 */
    22402360function bp_is_user_change_avatar() {
    22412361    return (bool) ( bp_is_profile_component() && bp_is_current_action( 'change-avatar' ) );
     
    22602380 * Eg http://example.com/members/joe/forums/ (or a subpage thereof).
    22612381 *
     2382 * @since 1.5.0
     2383 *
    22622384 * @return bool True if the current page is a user's forums page.
    22632385 */
     
    23062428 * Eg http://example.com/members/joe/groups/ (or a subpage thereof).
    23072429 *
     2430 * @since 1.1.0
     2431 *
    23082432 * @return bool True if the current page is a user's Groups page.
    23092433 */
     
    23172441 * Eg http://example.com/members/joe/blogs/ (or a subpage thereof).
    23182442 *
     2443 * @since 1.1.0
     2444 *
    23192445 * @return bool True if the current page is a user's Blogs page.
    23202446 */
     
    23282454 * Eg http://example.com/members/joe/blogs/recent-posts/.
    23292455 *
     2456 * @since 1.1.0
     2457 *
    23302458 * @return bool True if the current page is a user's Recent Blog Posts page.
    23312459 */
     
    23392467 * Eg http://example.com/members/joe/blogs/recent-comments/.
    23402468 *
     2469 * @since 1.1.0
     2470 *
    23412471 * @return bool True if the current page is a user's Recent Blog Comments page.
    23422472 */
     
    23502480 * Eg http://example.com/members/joe/blogs/friends/ (or a subpage thereof).
    23512481 *
     2482 * @since 1.1.0
     2483 *
    23522484 * @return bool True if the current page is a user's Friends page.
    23532485 */
     
    23612493 * Eg http://example.com/members/joe/friends/requests/.
    23622494 *
     2495 * @since 1.5.0
     2496 *
    23632497 * @return bool True if the current page is a user's Friends Requests page.
    23642498 */
     
    23842518 *
    23852519 * Eg http://example.com/members/joe/settings/ (or a subpage thereof).
     2520 *
     2521 * @since 1.5.0
    23862522 *
    23872523 * @return bool True if the current page is a user's Settings page.
     
    24652601 * Will return true for any subpage of a single group.
    24662602 *
     2603 * @since 1.2.0
     2604 *
    24672605 * @return bool True if the current page is part of a single group.
    24682606 */
     
    24822620 * URL will vary depending on which group tab is set to be the "home". By
    24832621 * default, it's the group's recent activity.
     2622 *
     2623 * @since 1.1.0
    24842624 *
    24852625 * @return bool True if the current page is a single group's home page.
     
    24962636 * Is the current page part of the group creation process?
    24972637 *
     2638 * @since 1.1.0
     2639 *
    24982640 * @return bool True if the current page is part of the group creation process.
    24992641 */
     
    25072649 * Eg http://example.com/groups/mygroup/admin/settings/.
    25082650 *
     2651 * @since 1.1.0
     2652 *
    25092653 * @return bool True if the current page is part of a single group's admin.
    25102654 */
     
    25172661 *
    25182662 * Only applies to legacy bbPress forums.
     2663 *
     2664 * @since 1.1.0
    25192665 *
    25202666 * @return bool True if the current page is a group forum page.
     
    25402686 * Is the current page a group's activity page?
    25412687 *
     2688 * @since 1.2.1
     2689 *
    25422690 * @return True if the current page is a group's activity page.
    25432691 */
     
    25612709 * Only applies to legacy bbPress (1.x) forums.
    25622710 *
     2711 * @since 1.1.0
     2712 *
    25632713 * @return bool True if the current page is part of a group forum topic.
    25642714 */
     
    25722722 * Only applies to legacy bbPress (1.x) forums.
    25732723 *
     2724 * @since 1.2.0
     2725 *
    25742726 * @return bool True if the current page is part of a group forum topic edit page.
    25752727 */
     
    25832735 * Eg http://example.com/groups/mygroup/members/.
    25842736 *
     2737 * @since 1.1.0
     2738 *
    25852739 * @return bool True if the current page is part of a group's Members page.
    25862740 */
     
    26042758 * Eg http://example.com/groups/mygroup/send-invites/.
    26052759 *
     2760 * @since 1.1.0
     2761 *
    26062762 * @return bool True if the current page is a group's Send Invites page.
    26072763 */
     
    26152771 * Eg http://example.com/groups/mygroup/request-membership/.
    26162772 *
     2773 * @since 1.2.0
     2774 *
    26172775 * @return bool True if the current page is a group's Request Membership page.
    26182776 */
     
    26232781/**
    26242782 * Is the current page a leave group attempt?
     2783 *
     2784 * @since 1.1.0
    26252785 *
    26262786 * @return bool True if the current page is a Leave Group attempt.
     
    26602820 * Eg http://example.com/sites/create/.
    26612821 *
     2822 * @since 1.1.0
     2823 *
    26622824 * @return bool True if the current page is the Create a Blog page.
    26632825 */
     
    26882850 * Eg http://example.com/members/joe/messages/ (or a subpage thereof).
    26892851 *
     2852 * @since 1.2.0
     2853 *
    26902854 * @return bool True if the current page is part of a user's Messages pages.
    26912855 */
     
    26982862 *
    26992863 * Eg http://example.com/members/joe/messages/inbox/.
     2864 *
     2865 * @since 1.1.0
    27002866 *
    27012867 * @return bool True if the current page is a user's Messages Inbox.
     
    27142880 * Eg http://example.com/members/joe/messages/sentbox/.
    27152881 *
     2882 * @since 1.1.0
     2883 *
    27162884 * @return bool True if the current page is a user's Messages Sentbox.
    27172885 */
     
    27252893 * Eg http://example.com/members/joe/messages/compose/.
    27262894 *
     2895 * @since 1.1.0
     2896 *
    27272897 * @return bool True if the current page is a user's Messages Compose screen.
    27282898 */
     
    27362906 * Eg http://example.com/members/joe/messages/notices/.
    27372907 *
     2908 * @since 1.1.0
     2909 *
    27382910 * @return bool True if the current page is the Notices screen.
    27392911 */
     
    27442916/**
    27452917 * Is the current page a single Messages conversation thread?
     2918 *
     2919 * @since 1.6.0
    27462920 *
    27472921 * @return bool True if the current page a single Messages conversation thread?
     
    27692943 * Eg http://example.com/activate/.
    27702944 *
     2945 * @since 1.1.0
     2946 *
    27712947 * @return bool True if the current page is the Activate page.
    27722948 */
     
    27802956 * Eg http://example.com/register/.
    27812957 *
     2958 * @since 1.1.0
     2959 *
    27822960 * @return bool True if the current page is the Register page.
    27832961 */
     
    27912969 * @since 2.4.3
    27922970 *
    2793  * @param string $seplocation
     2971 * @param string $seplocation Location for the separator.
    27942972 * @return array the title parts
    27952973 */
     
    27972975    $bp = buddypress();
    27982976
    2799     // Defaults to an empty array
     2977    // Defaults to an empty array.
    28002978    $bp_title_parts = array();
    28012979
     
    29263104/**
    29273105 * Customize the body class, according to the currently displayed BP content.
     3106 *
     3107 * @since 1.1.0
    29283108 */
    29293109function bp_the_body_class() {
     
    29343114     *
    29353115     * Uses the above is_() functions to output a body class for each scenario.
     3116     *
     3117     * @since 1.1.0
    29363118     *
    29373119     * @param array      $wp_classes     The body classes coming from WP.
  • trunk/src/bp-core/bp-core-theme-compatibility.php

    r10417 r10497  
    5353     * Template package properties, as passed to the constructor.
    5454     *
     55     * @since 1.7.0
    5556     * @var array
    5657     */
  • trunk/src/bp-core/bp-core-update.php

    r10474 r10497  
    4343function bp_is_update() {
    4444
    45     // Current DB version of this site (per site in a multisite network)
     45    // Current DB version of this site (per site in a multisite network).
    4646    $current_db   = bp_get_option( '_bp_db_version' );
    4747    $current_live = bp_get_db_version();
    4848
    49     // Compare versions (cast as int and bool to be safe)
     49    // Compare versions (cast as int and bool to be safe).
    5050    $is_update = (bool) ( (int) $current_db < (int) $current_live );
    5151
    52     // Return the product of version comparison
     52    // Return the product of version comparison.
    5353    return $is_update;
    5454}
     
    7474    }
    7575
    76     // Bail if not activating
     76    // Bail if not activating.
    7777    if ( empty( $action ) || !in_array( $action, array( 'activate', 'activate-selected' ) ) ) {
    7878        return false;
    7979    }
    8080
    81     // The plugin(s) being activated
     81    // The plugin(s) being activated.
    8282    if ( $action == 'activate' ) {
    8383        $plugins = isset( $_GET['plugin'] ) ? array( $_GET['plugin'] ) : array();
     
    8686    }
    8787
    88     // Set basename if empty
     88    // Set basename if empty.
    8989    if ( empty( $basename ) && !empty( $bp->basename ) ) {
    9090        $basename = $bp->basename;
    9191    }
    9292
    93     // Bail if no basename
     93    // Bail if no basename.
    9494    if ( empty( $basename ) ) {
    9595        return false;
     
    120120    }
    121121
    122     // Bail if not deactivating
     122    // Bail if not deactivating.
    123123    if ( empty( $action ) || !in_array( $action, array( 'deactivate', 'deactivate-selected' ) ) ) {
    124124        return false;
    125125    }
    126126
    127     // The plugin(s) being deactivated
     127    // The plugin(s) being deactivated.
    128128    if ( 'deactivate' == $action ) {
    129129        $plugins = isset( $_GET['plugin'] ) ? array( $_GET['plugin'] ) : array();
     
    132132    }
    133133
    134     // Set basename if empty
     134    // Set basename if empty.
    135135    if ( empty( $basename ) && !empty( $bp->basename ) ) {
    136136        $basename = $bp->basename;
    137137    }
    138138
    139     // Bail if no basename
     139    // Bail if no basename.
    140140    if ( empty( $basename ) ) {
    141141        return false;
     
    187187function bp_version_updater() {
    188188
    189     // Get the raw database version
     189    // Get the raw database version.
    190190    $raw_db_version = (int) bp_get_db_version_raw();
    191191
     
    207207    require_once( buddypress()->plugin_dir . '/bp-core/admin/bp-core-admin-schema.php' );
    208208
    209     // Install BP schema and activate only Activity and XProfile
     209    // Install BP schema and activate only Activity and XProfile.
    210210    if ( bp_is_install() ) {
    211211
    212         // Apply schema and set Activity and XProfile components as active
     212        // Apply schema and set Activity and XProfile components as active.
    213213        bp_core_install( $default_components );
    214214        bp_update_option( 'bp-active-components', $default_components );
     
    216216        bp_core_install_emails();
    217217
    218     // Upgrades
     218    // Upgrades.
    219219    } else {
    220220
    221         // Run the schema install to update tables
     221        // Run the schema install to update tables.
    222222        bp_core_install();
    223223
     
    269269    }
    270270
    271     /** All done! *************************************************************/
    272 
    273     // Bump the version
     271    /* All done! *************************************************************/
     272
     273    // Bump the version.
    274274    bp_version_bump();
    275275}
     
    290290    // 2.3.0: Change index lengths to account for utf8mb4.
    291291    if ( $raw_db_version < 9695 ) {
    292         // table_name => columns.
     292        // Map table_name => columns.
    293293        $tables = array(
    294294            $bp_prefix . 'bp_activity_meta'       => array( 'meta_key' ),
     
    321321function bp_update_to_1_5() {
    322322
    323     // Delete old database version options
     323    // Delete old database version options.
    324324    delete_site_option( 'bp-activity-db-version' );
    325325    delete_site_option( 'bp-blogs-db-version'    );
     
    339339function bp_update_to_1_6() {
    340340
    341     // Delete possible site options
     341    // Delete possible site options.
    342342    delete_site_option( 'bp-db-version'       );
    343343    delete_site_option( '_bp_db_version'      );
     
    345345    delete_site_option( '_bp-core-db-version' );
    346346
    347     // Delete possible blog options
     347    // Delete possible blog options.
    348348    delete_blog_option( bp_get_root_blog_id(), 'bp-db-version'       );
    349349    delete_blog_option( bp_get_root_blog_id(), 'bp-core-db-version'  );
     
    363363function bp_update_to_1_9() {
    364364
    365     // Setup hardcoded keys
     365    // Setup hardcoded keys.
    366366    $active_components_key      = 'bp-active-components';
    367367    $notifications_component_id = 'notifications';
    368368
    369     // Get the active components
     369    // Get the active components.
    370370    $active_components          = bp_get_option( $active_components_key );
    371371
    372     // Add notifications
     372    // Add notifications.
    373373    if ( ! in_array( $notifications_component_id, $active_components ) ) {
    374374        $active_components[ $notifications_component_id ] = 1;
    375375    }
    376376
    377     // Update the active components option
     377    // Update the active components option.
    378378    bp_update_option( $active_components_key, $active_components );
    379379}
     
    412412function bp_update_to_2_0() {
    413413
    414     /** Install activity tables for 'last_activity' ***************************/
     414    /* Install activity tables for 'last_activity' ***************************/
    415415
    416416    bp_core_install_activity_streams();
    417417
    418     /** Migrate 'last_activity' data ******************************************/
     418    /* Migrate 'last_activity' data ******************************************/
    419419
    420420    bp_last_activity_migrate();
    421421
    422     /** Migrate signups data **************************************************/
     422    /* Migrate signups data **************************************************/
    423423
    424424    if ( ! is_multisite() ) {
    425425
    426         // Maybe install the signups table
     426        // Maybe install the signups table.
    427427        bp_core_maybe_install_signups();
    428428
    429         // Run the migration script
     429        // Run the migration script.
    430430        bp_members_migrate_signups();
    431431    }
    432432
    433     /** Add BP options to the options table ***********************************/
     433    /* Add BP options to the options table ***********************************/
    434434
    435435    bp_add_options();
     
    461461function bp_update_to_2_2() {
    462462
    463     // Also handled by `bp_core_install()`
     463    // Also handled by `bp_core_install()`.
    464464    if ( bp_is_active( 'messages' ) ) {
    465465        bp_core_install_private_messaging();
     
    484484function bp_update_to_2_3() {
    485485
    486     // Also handled by `bp_core_install()`
     486    // Also handled by `bp_core_install()`.
    487487    if ( bp_is_active( 'notifications' ) ) {
    488488        bp_core_install_notifications();
     
    508508 * @global $wpdb
    509509 * @uses   buddypress()
    510  *
    511510 */
    512511function bp_migrate_new_member_activity_component() {
     
    514513    $bp = buddypress();
    515514
    516     // Update the component for the new_member type
     515    // Update the component for the new_member type.
    517516    $wpdb->update(
    518         // Activity table
     517        // Activity table.
    519518        $bp->members->table_name_last_activity,
    520519        array(
     
    525524            'type'      => 'new_member',
    526525        ),
    527         // Data sanitization format
     526        // Data sanitization format.
    528527        array(
    529528            '%s',
    530529        ),
    531         // WHERE sanitization format
     530        // WHERE sanitization format.
    532531        array(
    533532            '%s',
     
    563562function bp_add_activation_redirect() {
    564563
    565     // Bail if activating from network, or bulk
     564    // Bail if activating from network, or bulk.
    566565    if ( isset( $_GET['activate-multi'] ) ) {
    567566        return;
     
    569568
    570569    // Record that this is a new installation, so we show the right
    571     // welcome message
     570    // welcome message.
    572571    if ( bp_is_install() ) {
    573572        set_transient( '_bp_is_new_install', true, 30 );
    574573    }
    575574
    576     // Add the transient to redirect
     575    // Add the transient to redirect.
    577576    set_transient( '_bp_activation_redirect', true, 30 );
    578577}
     
    586585 *
    587586 * @global WPDB $wpdb
    588  *
    589  * @return bool|null If signups table exists.
    590587 */
    591588function bp_core_maybe_install_signups() {
    592589    global $wpdb;
    593590
    594     // The table to run queries against
     591    // The table to run queries against.
    595592    $signups_table = $wpdb->base_prefix . 'signups';
    596593
    597     // Suppress errors because users shouldn't see what happens next
     594    // Suppress errors because users shouldn't see what happens next.
    598595    $old_suppress  = $wpdb->suppress_errors();
    599596
    600     // Never use bp_core_get_table_prefix() for any global users tables
     597    // Never use bp_core_get_table_prefix() for any global users tables.
    601598    $table_exists  = (bool) $wpdb->get_results( "DESCRIBE {$signups_table};" );
    602599
     
    604601    if ( true === $table_exists ) {
    605602
    606         // Look for the 'signup_id' column
     603        // Look for the 'signup_id' column.
    607604        $column_exists = $wpdb->query( "SHOW COLUMNS FROM {$signups_table} LIKE 'signup_id'" );
    608605
     
    618615    }
    619616
    620     // Restore previous error suppression setting
     617    // Restore previous error suppression setting.
    621618    $wpdb->suppress_errors( $old_suppress );
    622619}
     
    638635    delete_site_transient( 'theme_roots' );
    639636
    640     // Add options
     637    // Add options.
    641638    bp_add_options();
    642639
  • trunk/src/bp-core/bp-core-widgets.php

    r10417 r10497  
    3030    /**
    3131     * Constructor method.
     32     *
     33     * @since 1.9.0
    3234     */
    3335    public function __construct() {
     
    4446    /**
    4547     * Display the login widget.
     48     *
     49     * @since 1.9.0
    4650     *
    4751     * @see WP_Widget::widget() for description of parameters.
     
    155159     * Update the login widget options.
    156160     *
     161     * @since 1.9.0
     162     *
    157163     * @param array $new_instance The new instance options.
    158164     * @param array $old_instance The old instance options.
     
    168174    /**
    169175     * Output the login widget options form.
     176     *
     177     * @since 1.9.0
    170178     *
    171179     * @param array $instance Settings for this widget.
  • trunk/src/bp-core/bp-core-wpabstraction.php

    r10417 r10497  
    3232}
    3333
    34 /**
     34/*
    3535 * Only add MS-specific abstraction functions if WordPress is not in multisite mode.
    3636 */
     
    4545        /**
    4646         * Retrieve blog option.
     47         *
     48         * @since 1.0.0
    4749         *
    4850         * @see get_blog_option()
     
    6264
    6365        /**
    64          * Add blog option
     66         * Add blog option.
     67         *
     68         * @since 1.2.0
    6569         *
    6670         * @see add_blog_option()
     
    8286         * Update blog option.
    8387         *
     88         * @since 1.2.0
     89         *
    8490         * @see update_blog_option()
    8591         *
     
    100106         * Delete blog option.
    101107         *
     108         * @since 1.5.0
     109         *
    102110         * @see delete_blog_option()
    103111         *
     
    117125         * Switch to specified blog.
    118126         *
     127         * @since 1.2.0
     128         *
    119129         * @see switch_to_blog()
    120130         *
     
    134144         * Restore current blog.
    135145         *
     146         * @since 1.2.0
     147         *
    136148         * @see restore_current_blog()
    137149         *
     
    148160         * Retrive blogs associated with user.
    149161         *
     162         * @since 1.2.0
     163         *
    150164         * @see get_blogs_of_user()
    151165         *
     
    161175
    162176    if ( !function_exists( 'update_blog_status' ) ) {
     177
    163178        /**
    164179         * Whether or not to update blog status.
     180         *
     181         * @since 1.2.0
    165182         *
    166183         * @see update_blog_status()
     
    179196
    180197    if ( !function_exists( 'is_subdomain_install' ) ) {
     198
    181199        /**
    182200         * Whether or not if subdomain install.
     201         *
     202         * @since 1.2.5.1
    183203         *
    184204         * @see is_subdomain_install()
     
    220240 */
    221241if ( !function_exists( 'mb_strlen' ) ) {
     242
    222243    /**
    223244     * Fallback implementation of mb_strlen(), hardcoded to UTF-8.
     
    245266
    246267if ( !function_exists( 'mb_strpos' ) ) {
     268
    247269    /**
    248270     * Fallback implementation of mb_strpos(), hardcoded to UTF-8.
     
    269291
    270292if ( !function_exists( 'mb_strrpos' ) ) {
     293
    271294    /**
    272295     * Fallback implementation of mb_strrpos(), hardcoded to UTF-8.
Note: See TracChangeset for help on using the changeset viewer.