Skip to:
Content

BuddyPress.org

Changeset 10012


Ignore:
Timestamp:
07/12/2015 12:49:36 AM (11 years ago)
Author:
tw2113
Message:

First pass at BP-Core docs cleanup.

See #6398.

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

Legend:

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

    r9819 r10012  
    6565 * @since BuddyPress (1.7.0)
    6666 *
    67  * @param int $blog_id
    68  * @param int $user_id
     67 * @param int    $blog_id
     68 * @param int    $user_id
    6969 * @param string $domain
    7070 * @param string $path
    71  * @param int $site_id
    72  * @param array $meta
     71 * @param int    $site_id
     72 * @param array  $meta
    7373 */
    7474function bp_new_site( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {
  • trunk/src/bp-core/admin/bp-core-admin-components.php

    r9819 r10012  
    22
    33/**
    4  * BuddyPress Admin Component Functions
     4 * BuddyPress Admin Component Functions.
    55 *
    66 * @package BuddyPress
     
    236236
    237237/**
    238  * Handle saving the Component settings
     238 * Handle saving the Component settings.
    239239 *
    240240 * @since BuddyPress (1.6.0)
     
    278278
    279279/**
    280  * Calculates the components that should be active after save, based on submitted settings
     280 * Calculates the components that should be active after save, based on submitted settings.
    281281 *
    282282 * The way that active components must be set after saving your settings must
     
    299299 * @since BuddyPress (1.7.0)
    300300 *
    301  * @param array This is the array of component settings coming from the POST
    302  *   global. You should stripslashes_deep() before passing to this function
     301 * @param array $submitted This is the array of component settings coming from the POST
     302 *                         global. You should stripslashes_deep() before passing to this function.
     303 *
    303304 * @return array The calculated list of component settings
    304305 */
     
    337338
    338339/**
    339  * Return a list of component information, optionally filtered by type
     340 * Return a list of component information, optionally filtered by type.
    340341 *
    341342 * We use this information both to build the markup for the admin screens, as
     
    344345 * @since BuddyPress (1.7.0)
    345346 *
    346  * @param string $type 'all', 'optional', 'retired', 'required'
     347 * @param string $type 'all', 'optional', 'retired', 'required'.
     348 *
    347349 * @return array An array of requested component data
    348350 */
  • trunk/src/bp-core/admin/bp-core-admin-functions.php

    r9873 r10012  
    22
    33/**
    4  * BuddyPress Common Admin Functions
     4 * BuddyPress Common Admin Functions.
    55 *
    66 * @package BuddyPress
     
    115115
    116116/**
    117  * Print admin messages to admin_notices or network_admin_notices
     117 * Print admin messages to admin_notices or network_admin_notices.
    118118 *
    119119 * BuddyPress combines all its messages into a single notice, to avoid a preponderance of yellow
     
    122122 * @since BuddyPress (1.5.0)
    123123 *
    124  * @uses bp_current_user_can() to check current user permissions before showing the notices
     124 * @uses bp_current_user_can() to check current user permissions before showing the notices.
    125125 * @uses bp_is_root_blog()
    126126 */
     
    159159
    160160/**
    161  * Add an admin notice to the BP queue
     161 * Add an admin notice to the BP queue.
    162162 *
    163163 * Messages added with this function are displayed in BuddyPress's general purpose admin notices
     
    168168 *
    169169 * @param string $notice The notice you are adding to the queue.
    170  * @param string $type The notice type; optional. Usually either "updated" or "error".
     170 * @param string $type   The notice type; optional. Usually either "updated" or "error".
    171171 */
    172172function bp_core_add_admin_notice( $notice = '', $type = 'updated' ) {
     
    190190
    191191/**
    192  * Verify that some BP prerequisites are set up properly, and notify the admin if not
     192 * Verify that some BP prerequisites are set up properly, and notify the admin if not.
    193193 *
    194194 * On every Dashboard page, this function checks the following:
    195  *   - that pretty permalinks are enabled
    196  *   - that every BP component that needs a WP page for a directory has one
    197  *   - that no WP page has multiple BP components associated with it
     195 *   - that pretty permalinks are enabled.
     196 *   - that every BP component that needs a WP page for a directory has one.
     197 *   - that no WP page has multiple BP components associated with it.
    198198 * The administrator will be shown a notice for each check that fails.
    199199 *
     
    328328
    329329/**
    330  * Redirect user to BuddyPress's What's New page on activation
     330 * Redirect user to BuddyPress's What's New page on activation.
    331331 *
    332332 * @since BuddyPress (1.7.0)
    333333 *
    334  * @internal Used internally to redirect BuddyPress to the about page on activation
    335  *
    336  * @uses get_transient() To see if transient to redirect exists
    337  * @uses delete_transient() To delete the transient if it exists
    338  * @uses is_network_admin() To bail if being network activated
    339  * @uses wp_safe_redirect() To redirect
    340  * @uses add_query_arg() To help build the URL to redirect to
    341  * @uses admin_url() To get the admin URL to index.php
     334 * @internal Used internally to redirect BuddyPress to the about page on activation.
     335 *
     336 * @uses get_transient() To see if transient to redirect exists.
     337 * @uses delete_transient() To delete the transient if it exists.
     338 * @uses is_network_admin() To bail if being network activated.
     339 * @uses wp_safe_redirect() To redirect.
     340 * @uses add_query_arg() To help build the URL to redirect to.
     341 * @uses admin_url() To get the admin URL to index.php.
    342342 */
    343343function bp_do_activation_redirect() {
     
    369369
    370370/**
    371  * Output the tabs in the admin area
     371 * Output the tabs in the admin area.
    372372 *
    373373 * @since BuddyPress (1.5.0)
     374 *
    374375 * @param string $active_tab Name of the tab that is active. Optional.
    375376 */
     
    409410 *
    410411 * @since BuddyPress (2.2.0)
     412 *
    411413 * @param string $active_tab Name of the tab that is active. Optional.
     414 *
     415 * @return string
    412416 */
    413417function bp_core_get_admin_tabs( $active_tab = '' ) {
     
    453457
    454458/**
    455  * adds contextual help to BuddyPress admin pages
     459 * adds contextual help to BuddyPress admin pages.
    456460 *
    457461 * @since BuddyPress (1.7.0)
    458462 * @todo Make this part of the BP_Component class and split into each component
     463 *
     464 * @param string $screen
    459465 */
    460466function bp_core_add_contextual_help( $screen = '' ) {
     
    543549
    544550/**
    545  * renders contextual help content to contextual help tabs
     551 * renders contextual help content to contextual help tabs.
    546552 *
    547553 * @since BuddyPress (1.7.0)
     554 *
     555 * @param string $tab
     556 *
     557 * @return string
    548558 */
    549559function bp_core_add_contextual_help_content( $tab = '' ) {
     
    582592
    583593/**
    584  * Add a separator to the WordPress admin menus
     594 * Add a separator to the WordPress admin menus.
    585595 *
    586596 * @since BuddyPress (1.7.0)
    587597 *
    588  * @uses bp_current_user_can() To check users capability on root blog
     598 * @uses bp_current_user_can() To check users capability on root blog.
    589599 */
    590600function bp_admin_separator() {
     
    617627
    618628/**
    619  * Tell WordPress we have a custom menu order
     629 * Tell WordPress we have a custom menu order.
    620630 *
    621631 * @since BuddyPress (1.7.0)
    622  *
    623  * @param bool $menu_order Menu order
    624  * @uses bp_current_user_can() To check users capability on root blog
     632 * @uses bp_current_user_can() To check users capability on root blog.
     633 *
     634 * @param bool $menu_order Menu order.
     635 *
    625636 * @return bool Always true
    626637 */
     
    636647
    637648/**
    638  * Move our custom separator above our custom post types
     649 * Move our custom separator above our custom post types.
    639650 *
    640651 * @since BuddyPress (1.7.0)
    641  *
    642  * @param array $menu_order Menu Order
    643  * @uses bp_current_user_can() To check users capability on root blog
     652 * @uses bp_current_user_can() To check users capability on root blog.
     653 *
     654 * @param array $menu_order Menu Order.
     655 *
    644656 * @return array Modified menu order
    645657 */
     
    703715
    704716/**
    705  * When using a WP_List_Table, get the currently selected bulk action
     717 * When using a WP_List_Table, get the currently selected bulk action.
    706718 *
    707719 * WP_List_Tables have bulk actions at the top and at the bottom of the tables,
     
    710722 *
    711723 * @since BuddyPress (1.7.0)
     724 *
    712725 * @return string
    713726 */
     
    727740
    728741/**
    729  * Register meta box and associated JS for BuddyPress WP Nav Menu .
     742 * Register meta box and associated JS for BuddyPress WP Nav Menu.
    730743 *
    731744 * @since BuddyPress (1.9.0)
     
    833846 * @since BuddyPress (2.0.0)
    834847 *
    835  * @param array $actions User row action links.
     848 * @param array  $actions    User row action links.
    836849 * @param object $user_object Current user information.
     850 *
    837851 * @return array $actions User row action links.
    838852 */
  • trunk/src/bp-core/admin/bp-core-admin-schema.php

    r9819 r10012  
    22
    33/**
    4  * BuddyPress DB schema
     4 * BuddyPress DB schema.
    55 *
    66 * @package BuddyPress
     
    1212
    1313/**
    14  * Get the DB schema to use for BuddyPress components
     14 * Get the DB schema to use for BuddyPress components.
    1515 *
    1616 * @since BuddyPress (1.1.0)
    1717 *
    1818 * @global $wpdb $wpdb
    19  * @return string The default database character-set, if set
     19 * @return string The default database character-set, if set.
    2020 */
    2121function bp_core_set_charset() {
     
    2828
    2929/**
    30  * Main installer
     30 * Main installer.
    3131 *
    3232 * Can be passed an optional array of components to explicitly run installation
     
    3535 * @since BuddyPress (1.0.0)
    3636 *
    37  * @param array $active_components Components to install
     37 * @param array|bool $active_components Components to install.
    3838 */
    3939function bp_core_install( $active_components = false ) {
     
    8686
    8787/**
    88  * Install database tables for the Notifications component
     88 * Install database tables for the Notifications component.
    8989 *
    9090 * @since BuddyPress (1.0.0)
     
    130130
    131131/**
    132  * Install database tables for the Activity component
     132 * Install database tables for the Activity component.
    133133 *
    134134 * @since BuddyPress (1.0.0)
     
    183183
    184184/**
    185  * Install database tables for the Notifications component
     185 * Install database tables for the Notifications component.
    186186 *
    187187 * @since BuddyPress (1.0.0)
     
    211211
    212212/**
    213  * Install database tables for the Groups component
     213 * Install database tables for the Groups component.
    214214 *
    215215 * @since BuddyPress (1.0.0)
     
    271271
    272272/**
    273  * Install database tables for the Messages component
     273 * Install database tables for the Messages component.
    274274 *
    275275 * @since BuddyPress (1.0.0)
     
    331331
    332332/**
    333  * Install database tables for the Profiles component
     333 * Install database tables for the Profiles component.
    334334 *
    335335 * @since BuddyPress (1.0.0)
     
    421421
    422422/**
    423  * Install database tables for the Sites component
     423 * Install database tables for the Sites component.
    424424 *
    425425 * @since BuddyPress (1.0.0)
     
    501501 * This is necessary because WordPress's `pre_schema_upgrade()` function wraps
    502502 * table ALTER's in multisite checks, and other plugins may have installed their
    503  * own sign-ups table; Eg: Gravity Forms User Registration Add On
     503 * own sign-ups table; Eg: Gravity Forms User Registration Add On.
    504504 *
    505505 * @since BuddyPress (2.0.1)
  • trunk/src/bp-core/admin/bp-core-admin-settings.php

    r9828 r10012  
    22
    33/**
    4  * BuddyPress Admin Settings
     4 * BuddyPress Admin Settings.
    55 *
    66 * @package BuddyPress
     
    1212
    1313/**
    14  * Main settings section description for the settings page
     14 * Main settings section description for the settings page.
    1515 *
    1616 * @since BuddyPress (1.6.0)
     
    1919
    2020/**
    21  * Admin bar for logged out users setting field
    22  *
    23  * @since BuddyPress (1.6.0)
    24  *
    25  * @uses bp_form_option() To output the option value
     21 * Admin bar for logged out users setting field.
     22 *
     23 * @since BuddyPress (1.6.0)
     24 *
     25 * @uses bp_form_option() To output the option value.
    2626 */
    2727function bp_admin_setting_callback_admin_bar() {
     
    3535
    3636/**
    37  * Allow members to delete their accounts setting field
    38  *
    39  * @since BuddyPress (1.6.0)
    40  *
    41  * @uses checked() To display the checked attribute
     37 * Allow members to delete their accounts setting field.
     38 *
     39 * @since BuddyPress (1.6.0)
     40 *
     41 * @uses checked() To display the checked attribute.
    4242 */
    4343function bp_admin_setting_callback_account_deletion() {
     
    5353
    5454/**
    55  * Groups settings section description for the settings page
     55 * Groups settings section description for the settings page.
    5656 *
    5757 * @since BuddyPress (1.6.0)
     
    6060
    6161/**
    62  * Allow Akismet setting field
    63  *
    64  * @since BuddyPress (1.6.0)
    65  *
    66  * @uses checked() To display the checked attribute
     62 * Allow Akismet setting field.
     63 *
     64 * @since BuddyPress (1.6.0)
     65 *
     66 * @uses checked() To display the checked attribute.
    6767 */
    6868function bp_admin_setting_callback_activity_akismet() {
     
    7676
    7777/**
    78  * Allow activity comments on blog posts and forum posts
     78 * Allow activity comments on blog posts and forum posts.
    7979 *
    8080 * @since BuddyPress (1.6.0)
     
    104104
    105105/**
    106  * Sanitization for bp-disable-blogforum-comments setting
     106 * Sanitization for bp-disable-blogforum-comments setting.
    107107 *
    108108 * In the UI, a checkbox asks whether you'd like to *enable* blog/forum activity comments. For
     
    111111 *
    112112 * @since BuddyPress (1.6.0)
     113 *
     114 * @param bool $value
     115 *
     116 * @return bool
    113117 */
    114118function bp_admin_sanitize_callback_blogforum_comments( $value = false ) {
     
    119123
    120124/**
    121  * Profile settings section description for the settings page
     125 * Profile settings section description for the settings page.
    122126 *
    123127 * @since BuddyPress (1.6.0)
     
    126130
    127131/**
    128  * Enable BP->WP profile syncing field
    129  *
    130  * @since BuddyPress (1.6.0)
    131  *
    132  * @uses bp_form_option() To output the option value
     132 * Enable BP->WP profile syncing field.
     133 *
     134 * @since BuddyPress (1.6.0)
     135 *
     136 * @uses bp_form_option() To output the option value.
    133137 */
    134138function bp_admin_setting_callback_profile_sync() {
     
    142146
    143147/**
    144  * Allow members to upload avatars field
    145  *
    146  * @since BuddyPress (1.6.0)
    147  *
    148  * @uses checked() To display the checked attribute
     148 * Allow members to upload avatars field.
     149 *
     150 * @since BuddyPress (1.6.0)
     151 *
     152 * @uses checked() To display the checked attribute.
    149153 */
    150154function bp_admin_setting_callback_avatar_uploads() {
     
    160164
    161165/**
    162  * Groups settings section description for the settings page
     166 * Groups settings section description for the settings page.
    163167 *
    164168 * @since BuddyPress (1.6.0)
     
    167171
    168172/**
    169  * Allow all users to create groups field
    170  *
    171  * @since BuddyPress (1.6.0)
    172  *
    173  * @uses checked() To display the checked attribute
     173 * Allow all users to create groups field.
     174 *
     175 * @since BuddyPress (1.6.0)
     176 *
     177 * @uses checked() To display the checked attribute.
    174178 */
    175179function bp_admin_setting_callback_group_creation() {
     
    198202
    199203/**
    200  * Forums settings section description for the settings page
     204 * Forums settings section description for the settings page.
    201205 *
    202206 * @since BuddyPress (1.6.0)
     
    205209
    206210/**
    207  * bb-config.php location field
    208  *
    209  * @since BuddyPress (1.6.0)
    210  * @uses checked() To display the checked attribute
    211  * @uses bp_get_option() To get the config location
    212  * @uses bp_form_option() To get the sanitized form option
     211 * bb-config.php location field.
     212 *
     213 * @since BuddyPress (1.6.0)
     214 * @uses checked() To display the checked attribute.
     215 * @uses bp_get_option() To get the config location.
     216 * @uses bp_form_option() To get the sanitized form option.
    213217 */
    214218function bp_admin_setting_callback_bbpress_configuration() {
     
    238242 * @since BuddyPress (1.6.0)
    239243 *
    240  * @uses screen_icon() To display the screen icon
    241  * @uses settings_fields() To output the hidden fields for the form
    242  * @uses do_settings_sections() To output the settings sections
     244 * @uses screen_icon() To display the screen icon.
     245 * @uses settings_fields() To output the hidden fields for the form.
     246 * @uses do_settings_sections() To output the settings sections.
    243247 */
    244248function bp_core_admin_settings() {
     
    271275
    272276/**
    273  * Save our settings
     277 * Save our settings.
    274278 *
    275279 * @since BuddyPress (1.6.0)
     
    318322
    319323/**
    320  * Output settings API option
     324 * Output settings API option.
    321325 *
    322326 * @since BuddyPress (1.6.0)
     
    326330 * @param string $option
    327331 * @param string $default
    328  * @param bool $slug
     332 * @param bool   $slug
    329333 */
    330334function bp_form_option( $option, $default = '' , $slug = false ) {
     
    342346         * @param string $option
    343347         * @param string $default
    344          * @param bool $slug
     348         * @param bool   $slug
     349         *
     350         * @return string
    345351         */
    346352        function bp_get_form_option( $option, $default = '', $slug = false ) {
  • trunk/src/bp-core/admin/bp-core-admin-slugs.php

    r9819 r10012  
    22
    33/**
    4  * BuddyPress Admin Slug Functions
     4 * BuddyPress Admin Slug Functions.
    55 *
    66 * @package BuddyPress
     
    215215
    216216/**
    217  * Handle saving of the BuddyPress slugs
     217 * Handle saving of the BuddyPress slugs.
    218218 *
    219219 * @since BuddyPress (1.6.0)
  • trunk/src/bp-core/admin/bp-core-admin-tools.php

    r9819 r10012  
    22
    33/**
    4  * BuddyPress Tools panel
     4 * BuddyPress Tools panel.
    55 *
    66 * @since BuddyPress (2.0.0)
     
    261261
    262262/**
    263  * Recalculate user-to-blog relationships and useful blog meta data
     263 * Recalculate user-to-blog relationships and useful blog meta data.
    264264 *
    265265 * @since BuddyPress (2.1.0)
     
    322322 * @since BuddyPress (2.0.0)
    323323 *
    324  * @param string $message Feedback message.
    325  * @param unknown $class Unused.
     324 * @param string      $message Feedback message.
     325 * @param string|bool $class   Unused.
     326 *
     327 * @return bool
    326328 */
    327329function bp_admin_tools_feedback( $message, $class = false ) {
  • trunk/src/bp-core/bp-core-actions.php

    r9819 r10012  
    4646
    4747/**
    48  * bp_loaded - Attached to 'plugins_loaded' above
     48 * bp_loaded - Attached to 'plugins_loaded' above.
    4949 *
    5050 * Attach various loader actions to the bp_loaded action.
     
    6161
    6262/**
    63  * bp_init - Attached to 'init' above
     63 * bp_init - Attached to 'init' above.
    6464 *
    6565 * Attach various initialization actions to the bp_init action.
     
    7979
    8080/**
    81  * bp_template_redirect - Attached to 'template_redirect' above
     81 * bp_template_redirect - Attached to 'template_redirect' above.
    8282 *
    8383 * Attach various template actions to the bp_template_redirect action.
     
    9696
    9797/**
    98  * Add the BuddyPress functions file
     98 * Add the BuddyPress functions file.
    9999 */
    100100add_action( 'bp_after_setup_theme', 'bp_load_theme_functions', 1 );
  • trunk/src/bp-core/bp-core-admin.php

    r9909 r10012  
    421421         * @since BuddyPress (1.6.0)
    422422         *
    423          * @param array $links Links array in which we would prepend our link.
    424          * @param string $file Current plugin basename.
     423         * @param array  $links Links array in which we would prepend our link.
     424         * @param string $file  Current plugin basename.
     425         *
    425426         * @return array Processed links.
    426427         */
     
    775776
    776777        /**
    777          * Output welcome text and badge for What's New and Credits pages
     778         * Output welcome text and badge for What's New and Credits pages.
    778779         *
    779780         * @since BuddyPress (2.2.0)
     
    799800
    800801        /**
    801          * Output tab navigation for `What's New` and `Credits` pages
     802         * Output tab navigation for `What's New` and `Credits` pages.
    802803         *
    803804         * @since BuddyPress (2.2.0)
     
    821822
    822823        /**
    823          * Return true/false based on whether a query argument is set
     824         * Return true/false based on whether a query argument is set.
    824825         *
    825826         * @see bp_do_activation_redirect()
    826827         *
    827828         * @since BuddyPress (2.2.0)
     829         *
    828830         * @return bool
    829831         */
     
    833835
    834836        /**
    835          * Return a user-friendly version-number string, for use in translations
     837         * Return a user-friendly version-number string, for use in translations.
    836838         *
    837839         * @since BuddyPress (2.2.0)
     840         *
    838841         * @return string
    839842         */
  • trunk/src/bp-core/bp-core-adminbar.php

    r9819 r10012  
    111111
    112112/**
    113  * Enqueue supplemental WordPress Toolbar styling
     113 * Enqueue supplemental WordPress Toolbar styling.
    114114 *
    115115 * @since BuddyPress (2.1.0)
  • trunk/src/bp-core/bp-core-attachments.php

    r9860 r10012  
    1919 * @since  BuddyPress (2.3.0)
    2020 *
    21  * @return bool True if WordPress is 3.9+, false otherwise
     21 * @return bool True if WordPress is 3.9+, false otherwise.
    2222 */
    2323function bp_attachments_is_wp_version_supported() {
     
    2626
    2727/**
    28  * Get the BuddyPress Plupload settings
    29  *
    30  * @since  BuddyPress (2.3.0)
    31  *
    32  * @return array list of BuddyPress Plupload settings
     28 * Get the BuddyPress Plupload settings.
     29 *
     30 * @since  BuddyPress (2.3.0)
     31 *
     32 * @return array list of BuddyPress Plupload settings.
    3333 */
    3434function bp_attachments_get_plupload_default_settings() {
     
    8484
    8585/**
    86  * Builds localization strings for the BuddyPress Uploader scripts
    87  *
    88  * @since  BuddyPress (2.3.0)
    89  *
    90  * @return array Plupload default localization strings
     86 * Builds localization strings for the BuddyPress Uploader scripts.
     87 *
     88 * @since  BuddyPress (2.3.0)
     89 *
     90 * @return array Plupload default localization strings.
    9191 */
    9292function bp_attachments_get_plupload_l10n() {
     
    120120
    121121/**
    122  * Enqueues the script needed for the Uploader UI
     122 * Enqueues the script needed for the Uploader UI.
    123123 *
    124124 * @see  BP_Attachment::script_data() && BP_Attachment_Avatar::script_data() for examples showing how
    125  * to set specific script data
    126  *
    127  * @since  BuddyPress (2.3.0)
    128  *
    129  * @param  string $class name of the class extending BP_Attachment (eg: BP_Attachment_Avatar)
     125 * to set specific script data.
     126 *
     127 * @since  BuddyPress (2.3.0)
     128 *
     129 * @param  string $class name of the class extending BP_Attachment (eg: BP_Attachment_Avatar).
     130 *
     131 * @return null|WP_Error
    130132 */
    131133function bp_attachments_enqueue_scripts( $class = '' ) {
     
    240242
    241243                /**
    242                  * Use this filter to add a navigation to a custom tool to set the object's avatar
     244                 * Use this filter to add a navigation to a custom tool to set the object's avatar.
    243245                 *
    244246                 * @since BuddyPress (2.3.0)
     
    246248                 * @param array $avatar_nav An associative array of available nav items where each item is an array organized this way:
    247249                 * $avatar_nav[ $nav_item_id ] {
    248                  *     @type string $nav_item_id the nav item id in lower case without special characters or space
    249                  *     @type string $caption     the name of the item nav that will be displayed in the nav
    250                  *     @type int    $order       An integer to specify the priority of the item nav, choose one
    251                  *                               between 1 and 99 to be after the uploader nav item and before the delete nav item
    252                  *     @type int    $hide        if set to 1 the item nav will be hidden
    253                  *                               (only used for the delete nav item)
     250                 *     @type string $nav_item_id The nav item id in lower case without special characters or space.
     251                 *     @type string $caption     The name of the item nav that will be displayed in the nav.
     252                 *     @type int    $order       An integer to specify the priority of the item nav, choose one.
     253                 *                               between 1 and 99 to be after the uploader nav item and before the delete nav item.
     254                 *     @type int    $hide        If set to 1 the item nav will be hidden
     255                 *                               (only used for the delete nav item).
    254256                 * }
    255257                 * @param string $object the object the avatar belongs to (eg: user or group)
     
    298300         * to avoid the scripts to be loaded more than once.
    299301         *
    300          * @since BuddyPress 2.3.0
     302         * @since BuddyPress (2.3.0)
    301303         */
    302304        do_action( 'bp_attachments_enqueue_scripts' );
     
    304306
    305307/**
    306  * Check the current user's capability to edit an avatar for a given object
    307  *
    308  * @since  BuddyPress (2.3.0)
    309  *
    310  * @param  string $capability the capability to check
    311  * @param  array  $args an array containing the item_id and the object to check
     308 * Check the current user's capability to edit an avatar for a given object.
     309 *
     310 * @since  BuddyPress (2.3.0)
     311 *
     312 * @param  string $capability The capability to check.
     313 * @param  array  $args       An array containing the item_id and the object to check.
     314 *
     315 * @return bool
    312316 */
    313317function bp_attachments_current_user_can( $capability, $args = array() ) {
     
    351355 * @since  BuddyPress (2.3.0)
    352356 *
    353  * @param  bool true for a success, false otherwise
    354  * @param  bool true if the Plupload runtime used is html4, false otherwise.
    355  * @param  mixed $data Data to encode as JSON, then print and die.
     357 * @param  bool  $success  True for a success, false otherwise.
     358 * @param  bool  $is_html4 True if the Plupload runtime used is html4, false otherwise.
     359 * @param  mixed $data     Data to encode as JSON, then print and die.
    356360 */
    357361function bp_attachments_json_response( $success, $is_html4 = false, $data = null ) {
     
    381385 * Get an Attachment template part.
    382386 *
    383  * @since  BuddyPress (2.3.0)
    384  *
    385  * @param  string Template part slug. eg 'uploader' for 'uploader.php'.
     387 * @since BuddyPress (2.3.0)
     388 *
     389 * @param string $slug Template part slug. eg 'uploader' for 'uploader.php'.
     390 *
     391 * @return bool
    386392 */
    387393function bp_attachments_get_template_part( $slug ) {
  • trunk/src/bp-core/bp-core-avatars.php

    r9860 r10012  
    108108 *    add_filter( 'bp_core_fetch_avatar_no_grav', '__return_true' );
    109109 *
    110  * @param array $args {
     110 * @param array|string $args {
    111111 *     An array of arguments. All arguments are technically optional; some
    112112 *     will, if not provided, be auto-detected by bp_core_fetch_avatar(). This
     
    114114 *     arguments.
    115115 *
    116  *     @type int|bool $item_id The numeric ID of the item for which you're
    117  *           requesting an avatar (eg, a user ID). If no 'item_id' is present,
    118  *           the function attempts to infer an ID from the 'object' + the
    119  *           current context: if 'object' is 'user' and the current page is a
    120  *           user page, 'item_id' will default to the displayed user ID; if
    121  *           'group' and on a group page, to the current group ID; if 'blog',
    122  *           to the current blog's ID. If no 'item_id' can be determined in
    123  *           this way, the function returns false. Default: false.
    124  *     @type string $object The kind of object for which you're getting an
    125  *           avatar. BuddyPress natively supports three options: 'user',
    126  *           'group', 'blog'; a plugin may register more.  Default: 'user'.
    127  *     @type string $type When a new avatar is uploaded to BP, 'thumb' and
    128  *           'full' versions are saved. This parameter specifies whether you'd
    129  *           like the 'full' or smaller 'thumb' avatar. Default: 'thumb'.
     116 *     @type int|bool    $item_id    The numeric ID of the item for which you're requesting
     117 *                                   an avatar (eg, a user ID). If no 'item_id' is present,
     118 *                                   the function attempts to infer an ID from the 'object' + the
     119 *                                   current context: if 'object' is 'user' and the current page is a
     120 *                                   user page, 'item_id' will default to the displayed user ID; if
     121 *                                   'group' and on a group page, to the current group ID; if 'blog',
     122 *                                   to the current blog's ID. If no 'item_id' can be determined in
     123 *                                   this way, the function returns false. Default: false.
     124 *     @type string      $object    The kind of object for which you're getting an
     125 *                                   avatar. BuddyPress natively supports three options: 'user',
     126 *                                   'group', 'blog'; a plugin may register more.  Default: 'user'.
     127 *     @type string      $type      When a new avatar is uploaded to BP, 'thumb' and
     128 *                                   'full' versions are saved. This parameter specifies whether you'd
     129 *                                   like the 'full' or smaller 'thumb' avatar. Default: 'thumb'.
    130130 *     @type string|bool $avatar_dir The name of the subdirectory where the
    131  *           requested avatar should be found. If no value is passed,
    132  *           'avatar_dir' is inferred from 'object': 'user' becomes 'avatars',
    133  *           'group' becomes 'group-avatars', 'blog' becomes 'blog-avatars'.
    134  *           Remember that this string denotes a subdirectory of BP's main
    135  *           avatar directory (usually based on {@link wp_upload_dir()}); it's a
    136  *           string like 'group-avatars' rather than the full directory path.
    137  *           Generally, it'll only be necessary to override the default value if
    138  *           storing avatars in a non-default location. Defaults to false
    139  *           (auto-detected).
    140  *     @type int|bool $width Requested avatar width. The unit is px. This value
    141  *           is used to build the 'width' attribute for the <img> element. If
    142  *           no value is passed, BP uses the global avatar width for this
    143  *           avatar type. Default: false (auto-detected).
    144  *     @type int|bool $height Requested avatar height. The unit is px. This
    145  *           value is used to build the 'height' attribute for the <img>
    146  *           element. If no value is passed, BP uses the global avatar height
    147  *           for this avatar type. Default: false (auto-detected).
    148  *     @type string $class The CSS class for the <img> element. Note that BP
    149  *           uses the 'avatar' class fairly extensively in its default styling,
    150  *           so if you plan to pass a custom value, consider appending it to
    151  *           'avatar' (eg 'avatar foo') rather than replacing it altogether.
    152  *           Default: 'avatar'.
    153  *     @type string|bool $css_id The CSS id for the <img> element.
    154  *           Default: false.
    155  *     @type string $title The title attribute for the <img> element.
    156  *           Default: false.
    157  *     @type string $alt The alt attribute for the <img> element. In BP, this
    158  *           value is generally passed by the wrapper functions, where the data
    159  *           necessary for concatenating the string is at hand; see
    160  *           {@link bp_get_activity_avatar()} for an example. Default: ''.
    161  *     @type string|bool $email An email to use in Gravatar queries. Unless
    162  *           otherwise configured, BP uses Gravatar as a fallback for avatars
    163  *           that are not provided locally. Gravatar's API requires using a hash
    164  *           of the user's email address; this argument provides it. If not
    165  *           provided, the function will infer it: for users, by getting the
    166  *           user's email from the database, for groups/blogs, by concatenating
    167  *           "{$item_id}-{$object}@{bp_get_root_domain()}". The user query adds
    168  *           overhead, so it's recommended that wrapper functions provide a
    169  *           value for 'email' when querying user IDs. Default: false.
    170  *     @type bool $no_grav Whether to disable the default Gravatar fallback.
    171  *           By default, BP will fall back on Gravatar when it cannot find a
    172  *           local avatar. In some cases, this may be undesirable, in which
    173  *           case 'no_grav' should be set to true. To disable Gravatar
    174  *           fallbacks globally, see the 'bp_core_fetch_avatar_no_grav' filter.
    175  *           Default: false.
    176  *     @type bool $html Whether to return an <img> HTML element, vs a raw URL
    177  *           to an avatar. If false, <img>-specific arguments (like 'css_id')
    178  *           will be ignored. Default: true.
     131 *                                   requested avatar should be found. If no value is passed,
     132 *                                   'avatar_dir' is inferred from 'object': 'user' becomes 'avatars',
     133 *                                   'group' becomes 'group-avatars', 'blog' becomes 'blog-avatars'.
     134 *                                   Remember that this string denotes a subdirectory of BP's main
     135 *                                   avatar directory (usually based on {@link wp_upload_dir()}); it's a
     136 *                                   string like 'group-avatars' rather than the full directory path.
     137 *                                   Generally, it'll only be necessary to override the default value if
     138 *                                   storing avatars in a non-default location. Defaults to false
     139 *                                   (auto-detected).
     140 *     @type int|bool    $width      Requested avatar width. The unit is px. This value
     141 *                                   is used to build the 'width' attribute for the <img> element. If
     142 *                                   no value is passed, BP uses the global avatar width for this
     143 *                                   avatar type. Default: false (auto-detected).
     144 *     @type int|bool    $height    Requested avatar height. The unit is px. This
     145 *                                   value is used to build the 'height' attribute for the <img>
     146 *                                   element. If no value is passed, BP uses the global avatar height
     147 *                                   for this avatar type. Default: false (auto-detected).
     148 *     @type string      $class      The CSS class for the <img> element. Note that BP
     149 *                                   uses the 'avatar' class fairly extensively in its default styling,
     150 *                                   so if you plan to pass a custom value, consider appending it to
     151 *                                   'avatar' (eg 'avatar foo') rather than replacing it altogether.
     152 *                                   Default: 'avatar'.
     153 *     @type string|bool $css_id     The CSS id for the <img> element.
     154 *                                   Default: false.
     155 *     @type string      $title      The title attribute for the <img> element.
     156 *                                   Default: false.
     157 *     @type string      $alt        The alt attribute for the <img> element. In BP, this
     158 *                                   value is generally passed by the wrapper functions, where the data
     159 *                                   necessary for concatenating the string is at hand; see
     160 *                                   {@link bp_get_activity_avatar()} for an example. Default: ''.
     161 *     @type string|bool $email      An email to use in Gravatar queries. Unless
     162 *                                   otherwise configured, BP uses Gravatar as a fallback for avatars
     163 *                                   that are not provided locally. Gravatar's API requires using a hash
     164 *                                   of the user's email address; this argument provides it. If not
     165 *                                   provided, the function will infer it: for users, by getting the
     166 *                                   user's email from the database, for groups/blogs, by concatenating
     167 *                                   "{$item_id}-{$object}@{bp_get_root_domain()}". The user query adds
     168 *                                   overhead, so it's recommended that wrapper functions provide a
     169 *                                   value for 'email' when querying user IDs. Default: false.
     170 *     @type bool       $no_grav    Whether to disable the default Gravatar fallback.
     171 *                                   By default, BP will fall back on Gravatar when it cannot find a
     172 *                                   local avatar. In some cases, this may be undesirable, in which
     173 *                                   case 'no_grav' should be set to true. To disable Gravatar
     174 *                                   fallbacks globally, see the 'bp_core_fetch_avatar_no_grav' filter.
     175 *                                   Default: false.
     176 *     @type bool       $html        Whether to return an <img> HTML element, vs a raw URL
     177 *                                   to an avatar. If false, <img>-specific arguments (like 'css_id')
     178 *                                   will be ignored. Default: true.
    179179 * }
     180 *
    180181 * @return string Formatted HTML <img> element, or raw avatar URL based on $html arg.
    181182 */
     
    530531                                return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $avatar_url . '"' . $html_class . $html_css_id  . $html_width . $html_height . $html_alt . $html_title . ' />', $params, $params['item_id'], $params['avatar_dir'], $html_css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir );
    531532
    532                         // ...or only the URL
     533                                // ...or only the URL
    533534                        } else {
    534535
     
    611612                }
    612613
    613         // No avatar was found, and we've been told not to use a gravatar.
     614                // No avatar was found, and we've been told not to use a gravatar.
    614615        } else {
    615616
     
    641642 * Delete an existing avatar.
    642643 *
    643  * @param array $args {
     644 * @param array|string $args {
    644645 *     Array of function parameters.
    645646 *     @type bool|int $item_id ID of the item whose avatar you're deleting.
     
    721722
    722723/**
    723  * Ajax delete an avatar for a given object and item id
    724  *
    725  * @since  BuddyPress (2.3.0)
    726  *
    727  * @return  string a json object containing success data if the avatar was deleted
    728  *                 error message otherwise
     724 * Ajax delete an avatar for a given object and item id.
     725 *
     726 * @since BuddyPress (2.3.0)
     727 *
     728 * @return string|null A json object containing success data if the avatar was deleted
     729 *                     error message otherwise.
    729730 */
    730731function bp_avatar_ajax_delete() {
     
    855856
    856857/**
    857  * Ajax upload an avatar
     858 * Ajax upload an avatar.
    858859 *
    859860 * @since BuddyPress (2.3.0)
    860861 *
    861  * @return  string a json object containing success data if the upload succeeded
    862  *                 error message otherwise
     862 * @return  string|null A json object containing success data if the upload succeeded
     863 *                      error message otherwise.
    863864 */
    864865function bp_avatar_ajax_upload() {
     
    923924        } else {
    924925                /**
    925                  * Filter here to deal with other components
     926                 * Filter here to deal with other components.
    926927                 *
    927928                 * @since BuddyPress (2.3.0)
    928929                 *
    929                  * @var array $bp_params the BuddyPress Ajax parameters
     930                 * @var array $bp_params the BuddyPress Ajax parameters.
    930931                 */
    931932                $bp_params = apply_filters( 'bp_core_avatar_ajax_upload_params', $bp_params );
     
    10081009 * @since BuddyPress (2.3.0)
    10091010 *
    1010  * @param string $data base64 encoded image.
    1011  * @param int $item_id.
     1011 * @param string $data     Base64 encoded image.
     1012 * @param int    $item_id.
     1013  *
    10121014 * @return bool True on success, false on failure.
    10131015 */
     
    10261028        }
    10271029
     1030        /**
     1031         * Filters the Avatar folder directory.
     1032         *
     1033         * @since BuddyPress (2.3.0)
     1034         *
     1035         * @param string $avatar_dir Directory for storing avatars.
     1036         * @param int    $item_id    ID of the item being acted on.
     1037         * @param string $value      Avatar type.
     1038         * @param string $value      Avatars word.
     1039         */
    10281040        $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', $avatar_dir . '/' . $item_id, $item_id, 'user', 'avatars' );
    10291041
     
    10431055                $crop_args = array( 'item_id' => $item_id, 'original_file' => $avatar_to_crop, 'crop_x' => 0, 'crop_y' => 0 );
    10441056
     1057                /**
     1058                 * Fires if the new avatar was successfully captured.
     1059                 *
     1060                 * @since BuddyPress (2.3.0)
     1061                 */
    10451062                do_action( 'xprofile_avatar_uploaded' );
    10461063
     
    10641081 *  crop_y - The vertical starting point of the crop
    10651082 *
    1066  * @param array $args {
     1083 * @param array|string $args {
    10671084 *     Array of function parameters.
    1068  *     @type string $object Object type of the item whose avatar you're
    1069  *           handling. 'user', 'group', 'blog', or custom. Default: 'user'.
    1070  *     @type string $avatar_dir Subdirectory where avatar should be stored.
    1071  *           Default: 'avatars'.
    1072  *     @type bool|int $item_id ID of the item that the avatar belongs to.
    1073  *     @type bool|string $original_file Absolute path to the original avatar
    1074  *           file.
    1075  *     @type int $crop_w Crop width. Default: the global 'full' avatar width,
    1076  *           as retrieved by bp_core_avatar_full_width().
    1077  *     @type int $crop_h Crop height. Default: the global 'full' avatar height,
    1078  *           as retrieved by bp_core_avatar_full_height().
    1079  *     @type int $crop_x The horizontal starting point of the crop. Default: 0.
    1080  *     @type int $crop_y The vertical starting point of the crop. Default: 0.
     1085 *
     1086 *     @type string      $object        Object type of the item whose avatar you're
     1087 *                                      handling. 'user', 'group', 'blog', or custom.
     1088 *                                      Default: 'user'.
     1089 *     @type string      $avatar_dir    Subdirectory where avatar should be stored.
     1090 *                                      Default: 'avatars'.
     1091 *     @type bool|int    $item_id       ID of the item that the avatar belongs to.
     1092 *     @type bool|string $original_file Absolute path to the original avatar file.
     1093 *     @type int         $crop_w        Crop width. Default: the global 'full' avatar width,
     1094 *                                      as retrieved by bp_core_avatar_full_width().
     1095 *     @type int         $crop_h        Crop height. Default: the global 'full' avatar height,
     1096 *                                      as retrieved by bp_core_avatar_full_height().
     1097 *     @type int         $crop_x        The horizontal starting point of the crop. Default: 0.
     1098 *     @type int         $crop_y        The vertical starting point of the crop. Default: 0.
    10811099 * }
     1100 *
    10821101 * @return bool True on success, false on failure.
    10831102 */
     
    11031122         *
    11041123         * @param bool  $value Whether or not to crop.
    1105          * @param array $r     Array of parsed arguments for function
     1124         * @param array $r     Array of parsed arguments for function.
    11061125         */
    11071126        if ( ! apply_filters( 'bp_core_pre_avatar_handle_crop', true, $r ) ) {
     
    11221141
    11231142/**
    1124  * Ajax set an avatar for a given object and item id
     1143 * Ajax set an avatar for a given object and item id.
    11251144 *
    11261145 * @since BuddyPress (2.3.0)
    11271146 *
    1128  * @return  string a json object containing success data if the crop/capture succeeded
    1129  *                 error message otherwise
     1147 * @return  string|null A json object containing success data if the crop/capture succeeded
     1148 *                      error message otherwise.
    11301149 */
    11311150function bp_avatar_ajax_set() {
     
    12411260 * Filters 'get_avatar'.
    12421261 *
    1243  * @param string $avatar The avatar path passed to 'get_avatar'.
    1244  * @param int|string|object $user A user ID, email address, or comment object.
    1245  * @param int $size Size of the avatar image ('thumb' or 'full').
    1246  * @param string $default URL to a default image to use if no avatar is available.
    1247  * @param string $alt Alternate text to use in image tag. Default: ''.
     1262 * @param string            $avatar  The avatar path passed to 'get_avatar'.
     1263 * @param int|string|object $user    A user ID, email address, or comment object.
     1264 * @param int               $size    Size of the avatar image ('thumb' or 'full').
     1265 * @param string            $default URL to a default image to use if no avatar is available.
     1266 * @param string            $alt     Alternate text to use in image tag. Default: ''.
     1267 *
    12481268 * @return string BP avatar path, if found; else the original avatar path.
    12491269 */
     
    13071327 *
    13081328 * @param array $file The $_FILES array.
     1329 *
    13091330 * @return bool True if no errors are found. False if there are errors.
    13101331 */
     
    13201341 *
    13211342 * @param array $file The $_FILES array.
     1343 *
    13221344 * @return bool True if the avatar is under the size limit, otherwise false.
    13231345 */
     
    13301352
    13311353/**
    1332  * Get allowed avatar types
    1333  *
    1334  * @since  BuddyPress (2.3.0)
     1354 * Get allowed avatar types.
     1355 *
     1356 * @since BuddyPress (2.3.0)
    13351357 */
    13361358function bp_core_get_allowed_avatar_types() {
     
    13381360
    13391361        /**
    1340          * Use this filter to restrict image types
     1362         * Filters the list of allowed image types.
    13411363         *
    13421364         * @since BuddyPress (2.3.0)
    13431365         *
    1344          * @param array list of image types
     1366         * @param array $allowed_types List of image types.
    13451367         */
    13461368        $avatar_types = (array) apply_filters( 'bp_core_get_allowed_avatar_types', $allowed_types );
     
    13561378
    13571379/**
    1358  * Get allowed avatar mime types
    1359  *
    1360  * @since  BuddyPress (2.3.0)
     1380 * Get allowed avatar mime types.
     1381 *
     1382 * @since BuddyPress (2.3.0)
    13611383 */
    13621384function bp_core_get_allowed_avatar_mimes() {
     
    13821404 *
    13831405 * @param array $file The $_FILES array.
     1406 *
    13841407 * @return bool True if the file extension is permitted, otherwise false.
    13851408 */
     
    13991422 * @since BuddyPress (1.8.0)
    14001423 *
    1401  * @param string $type The variable we want to return from the $bp->avatars
    1402  *        object. Only 'upload_path' and 'url' are supported. Default: 'upload_path'.
     1424 * @param string $type The variable we want to return from the $bp->avatars object.
     1425 *                     Only 'upload_path' and 'url' are supported. Default: 'upload_path'.
     1426 *
    14031427 * @return string The avatar upload directory path.
    14041428 */
     
    14741498 * Get the absolute upload path for the WP installation.
    14751499 *
    1476  * @uses bp_core_get_upload_dir() To get upload directory info
     1500 * @uses bp_core_get_upload_dir() To get upload directory info.
    14771501 *
    14781502 * @return string Absolute path to WP upload directory.
     
    15151539 *
    15161540 * @param int $user_id ID of the user whose avatar is being checked.
     1541 *
    15171542 * @return bool True if the user has uploaded a local avatar. Otherwise false.
    15181543 */
     
    15421567 * @since BuddyPress (1.5.0)
    15431568 *
    1544  * @param string $type Dimension type you're fetching dimensions for. 'thumb'
    1545  *        or 'full'. Default: 'thumb'.
     1569 * @param string $type   Dimension type you're fetching dimensions for. 'thumb'
     1570 *                       or 'full'. Default: 'thumb'.
    15461571 * @param string $h_or_w Which dimension is being fetched. 'height' or 'width'.
    1547  *        Default: 'height'.
    1548  * @return int $dim The dimension.
     1572 *                       Default: 'height'.
     1573 *
     1574 * @return int|bool $dim The dimension.
    15491575 */
    15501576function bp_core_avatar_dimension( $type = 'thumb', $h_or_w = 'height' ) {
     
    15571583         * @since BuddyPress (1.5.0)
    15581584         *
    1559          * @param int    $dim    Dimension setting for the type.
    1560          * @param string $type   The type of avatar whose dimensions are requested. Default 'thumb'.
    1561          * @param string $h_or_w The dimension parameter being requested. Default 'height'.
     1585         * @param int|bool $dim    Dimension setting for the type.
     1586         * @param string   $type   The type of avatar whose dimensions are requested. Default 'thumb'.
     1587         * @param string   $h_or_w The dimension parameter being requested. Default 'height'.
    15621588         */
    15631589        return apply_filters( 'bp_core_avatar_dimension', $dim, $type, $h_or_w );
     
    16031629
    16041630/**
    1605  * Get the 'full' avatar width setting
     1631 * Get the 'full' avatar width setting.
    16061632 *
    16071633 * @since BuddyPress (1.5.0)
     
    16831709 * @since BuddyPress (1.5.0)
    16841710 *
    1685  * @param string $type 'local' if the fallback should be the locally-hosted
    1686  *        version of the mystery-man, 'gravatar' if the fallback should be
    1687  *        Gravatar's version. Default: 'gravatar'.
     1711 * @param string $type 'local' if the fallback should be the locally-hosted version
     1712 *                     of the mystery-man, 'gravatar' if the fallback should be
     1713 *                     Gravatar's version. Default: 'gravatar'.
     1714 *
    16881715 * @return string The URL of the default avatar.
    16891716 */
     
    17201747 * @since BuddyPress (1.5.0)
    17211748 *
    1722  * @param string $type 'local' if the fallback should be the locally-hosted
    1723  *        version of the mystery-man, 'gravatar' if the fallback should be
    1724  *        Gravatar's version. Default: 'gravatar'.
     1749 * @param string $type 'local' if the fallback should be the locally-hosted version
     1750 *                     of the mystery-man, 'gravatar' if the fallback should be
     1751 *                     Gravatar's version. Default: 'gravatar'.
     1752 *
    17251753 * @return string The URL of the default avatar thumb.
    17261754 */
     
    17501778
    17511779/**
    1752  * Reset the week parameter of the WordPress main query if needed
     1780 * Reset the week parameter of the WordPress main query if needed.
    17531781 *
    17541782 * When cropping an avatar, a $_POST['w'] var is sent, setting the 'week'
    17551783 * parameter of the WordPress main query to this posted var. To avoid
    1756  * notices, we need to make sure this 'week' query var is reset to 0
     1784 * notices, we need to make sure this 'week' query var is reset to 0.
    17571785 *
    17581786 * @since  BuddyPress (2.2.0)
    17591787 *
    1760  * @param  WP_Query $posts_query the main query object
     1788 * @param  WP_Query|null $posts_query the main query object.
     1789 *
    17611790 * @uses   bp_is_group_create()
    17621791 * @uses   bp_is_group_admin_page()
     
    17931822
    17941823/**
    1795  * Checks whether Avatar UI should be loaded
     1824 * Checks whether Avatar UI should be loaded.
    17961825 *
    17971826 * @since  BuddyPress (2.3.0)
    17981827 *
    1799  * @return bool True if Avatar UI should load, false otherwise
     1828 * @return bool True if Avatar UI should load, false otherwise.
    18001829 */
    18011830function bp_avatar_is_front_edit() {
     
    18291858         * @since  BuddyPress (2.3.0)
    18301859         *
    1831          * @var  bool whether to load the Avatar UI
     1860         * @param bool whether to load the Avatar UI.
    18321861         */
    18331862        return apply_filters( 'bp_avatar_is_front_edit', $retval );
     
    18351864
    18361865/**
    1837  * Checks whether the Webcam Avatar UI part should be loaded
     1866 * Checks whether the Webcam Avatar UI part should be loaded.
    18381867 *
    18391868 * @since  BuddyPress (2.3.0)
     
    18671896         * by returning false.
    18681897         *
    1869          * @since  BuddyPress (2.3.0)
    1870          *
    1871          * @var  bool whether to load Webcam Avatar UI part
     1898         * @since BuddyPress (2.3.0)
     1899         *
     1900         * @param bool whether to load Webcam Avatar UI part.
    18721901         */
    18731902        return apply_filters( 'bp_avatar_use_webcam', true );
     
    18751904
    18761905/**
    1877  * Template function to load the Avatar UI javascript templates
     1906 * Template function to load the Avatar UI javascript templates.
    18781907 *
    18791908 * @since  BuddyPress (2.3.0)
     
    18881917
    18891918/**
    1890  * Trick to check if the theme's BuddyPress templates are up to date
     1919 * Trick to check if the theme's BuddyPress templates are up to date.
    18911920 *
    18921921 * If the "avatar templates" are not including the new template tag, this will
  • trunk/src/bp-core/bp-core-buddybar.php

    r10003 r10012  
    1414/**
    1515 * Add an item to the main BuddyPress navigation array.
     16 *
     17 * @param array|string $args {
     18 *     Array describing the new nav item.
     19 *     @type string      $name                    Display name for the nav item.
     20 *     @type string      $slug                    Unique URL slug for the nav item.
     21 *     @type bool|string $item_css_id             Optional. 'id' attribute for the nav item. Default: the value of `$slug`.
     22 *     @type bool        $show_for_displayed_user Optional. Whether the nav item should be visible when viewing a
     23 *                                                member profile other than your own. Default: true.
     24 *     @type bool        $site_admin_only         Optional. Whether the nav item should be visible only to site admins
     25 *                                                (those with the 'bp_moderate' cap). Default: false.
     26 *     @type int         $position                Optional. Numerical index specifying where the item should appear in
     27 *                                                the nav array. Default: 99.
     28 *     @type callable    $screen_function         The callback function that will run when the nav item is clicked.
     29 *     @type bool|string $default_subnav_slug     Optional. The slug of the default subnav item to select when the nav
     30 *                                                item is clicked.
     31 * }
     32 * @return bool|null Returns false on failure.
     33 */
     34function bp_core_new_nav_item( $args = '' ) {
     35
     36        $defaults = array(
     37                'name'                    => false, // Display name for the nav item
     38                'slug'                    => false, // URL slug for the nav item
     39                'item_css_id'             => false, // The CSS ID to apply to the HTML of the nav item
     40                'show_for_displayed_user' => true,  // When viewing another user does this nav item show up?
     41                'site_admin_only'         => false, // Can only site admins see this nav item?
     42                'position'                => 99,    // Index of where this nav item should be positioned
     43                'screen_function'         => false, // The name of the function to run when clicked
     44                'default_subnav_slug'     => false  // The slug of the default subnav item to select when clicked
     45        );
     46
     47        $r = wp_parse_args( $args, $defaults );
     48
     49        // First, add the nav item link to the bp_nav array.
     50        $created = bp_core_create_nav_link( $r );
     51
     52        // To mimic the existing behavior, if bp_core_create_nav_link()
     53        // returns false, we make an early exit and don't attempt to register
     54        // the screen function.
     55        if ( false === $created ) {
     56                return false;
     57        }
     58
     59        // Then, hook the screen function for the added nav item.
     60        bp_core_register_nav_screen_function( $r );
     61
     62        /**
     63         * Fires after adding an item to the main BuddyPress navigation array.
     64         * Note that, when possible, the more specific action hooks
     65         * `bp_core_create_nav_link` or `bp_core_register_nav_screen_function`
     66         * should be used.
     67         *
     68         * @since BuddyPress (1.5.0)
     69         *
     70         * @param array $r        Parsed arguments for the nav item.
     71         * @param array $args     Originally passed in arguments for the nav item.
     72         * @param array $defaults Default arguments for a nav item.
     73         */
     74        do_action( 'bp_core_new_nav_item', $r, $args, $defaults );
     75}
     76
     77/**
     78 * Add a link to the main BuddyPress navigation array.
     79 *
     80 * @since BuddyPress (2.4.0)
    1681 *
    1782 * @param array $args {
     
    3297 * @return bool|null Returns false on failure.
    3398 */
    34 function bp_core_new_nav_item( $args = '' ) {
     99function bp_core_create_nav_link( $args = '' ) {
     100        $bp = buddypress();
    35101
    36102        $defaults = array(
     
    47113        $r = wp_parse_args( $args, $defaults );
    48114
    49         // First, add the nav item link to the bp_nav array.
    50         $created = bp_core_create_nav_link( $r );
    51 
    52         // To mimic the existing behavior, if bp_core_create_nav_link()
    53         // returns false, we make an early exit and don't attempt to register
    54         // the screen function.
    55         if ( false === $created ) {
    56                 return false;
    57         }
    58 
    59         // Then, hook the screen function for the added nav item.
    60         bp_core_register_nav_screen_function( $r );
     115        // If we don't have the required info we need, don't create this nav item.
     116        if ( empty( $r['name'] ) || empty( $r['slug'] ) ) {
     117                return false;
     118        }
     119
     120        // If this is for site admins only and the user is not one, don't create the nav item.
     121        if ( ! empty( $r['site_admin_only'] ) && ! bp_current_user_can( 'bp_moderate' ) ) {
     122                return false;
     123        }
    61124
    62125        /**
    63          * Fires after adding an item to the main BuddyPress navigation array.
    64          * Note that, when possible, the more specific action hooks
    65          * `bp_core_create_nav_link` or `bp_core_register_nav_screen_function`
    66          * should be used.
     126         * If this nav item is hidden for the displayed user, and
     127         * the logged in user is not the displayed user
     128         * looking at their own profile, don't create the nav item.
     129         */
     130        if ( empty( $r['show_for_displayed_user'] ) && ! bp_user_has_access() ) {
     131                return false;
     132        }
     133
     134        if ( empty( $r['item_css_id'] ) ) {
     135                $r['item_css_id'] = $r['slug'];
     136        }
     137
     138        $bp->bp_nav[$r['slug']] = array(
     139                'name'                    => $r['name'],
     140                'slug'                    => $r['slug'],
     141                'link'                    => trailingslashit( bp_loggedin_user_domain() . $r['slug'] ),
     142                'css_id'                  => $r['item_css_id'],
     143                'show_for_displayed_user' => $r['show_for_displayed_user'],
     144                'position'                => $r['position'],
     145                'screen_function'         => &$r['screen_function'],
     146                'default_subnav_slug'     => $r['default_subnav_slug']
     147        );
     148
     149        /**
     150         * Fires after a link is added to the main BuddyPress navigation array.
    67151         *
    68          * @since BuddyPress (1.5.0)
     152         * @since BuddyPress (2.4.0)
    69153         *
    70154         * @param array $r        Parsed arguments for the nav item.
     
    72156         * @param array $defaults Default arguments for a nav item.
    73157         */
    74         do_action( 'bp_core_new_nav_item', $r, $args, $defaults );
    75 }
    76 
    77 /**
    78  * Add a link to the main BuddyPress navigation array.
     158        do_action( 'bp_core_create_nav_link', $r, $args, $defaults );
     159}
     160
     161/**
     162 * Register a screen function for an item in the main nav array.
    79163 *
    80164 * @since BuddyPress (2.4.0)
     
    97181 * @return bool|null Returns false on failure.
    98182 */
    99 function bp_core_create_nav_link( $args = '' ) {
     183function bp_core_register_nav_screen_function( $args = '' ) {
    100184        $bp = buddypress();
    101185
     
    113197        $r = wp_parse_args( $args, $defaults );
    114198
    115         // If we don't have the required info we need, don't create this nav item.
    116         if ( empty( $r['name'] ) || empty( $r['slug'] ) ) {
    117                 return false;
    118         }
    119 
    120         // If this is for site admins only and the user is not one, don't create the nav item.
    121         if ( ! empty( $r['site_admin_only'] ) && ! bp_current_user_can( 'bp_moderate' ) ) {
    122                 return false;
    123         }
    124 
    125         /**
    126          * If this nav item is hidden for the displayed user, and
    127          * the logged in user is not the displayed user
    128          * looking at their own profile, don't create the nav item.
    129          */
    130         if ( empty( $r['show_for_displayed_user'] ) && ! bp_user_has_access() ) {
    131                 return false;
    132         }
    133 
    134         if ( empty( $r['item_css_id'] ) ) {
    135                 $r['item_css_id'] = $r['slug'];
    136         }
    137 
    138         $bp->bp_nav[$r['slug']] = array(
    139                 'name'                    => $r['name'],
    140                 'slug'                    => $r['slug'],
    141                 'link'                    => trailingslashit( bp_loggedin_user_domain() . $r['slug'] ),
    142                 'css_id'                  => $r['item_css_id'],
    143                 'show_for_displayed_user' => $r['show_for_displayed_user'],
    144                 'position'                => $r['position'],
    145                 'screen_function'         => &$r['screen_function'],
    146                 'default_subnav_slug'     => $r['default_subnav_slug']
    147         );
    148 
    149         /**
    150          * Fires after a link is added to the main BuddyPress navigation array.
    151          *
    152          * @since BuddyPress (2.4.0)
    153          *
    154          * @param array $r        Parsed arguments for the nav item.
    155          * @param array $args     Originally passed in arguments for the nav item.
    156          * @param array $defaults Default arguments for a nav item.
    157          */
    158         do_action( 'bp_core_create_nav_link', $r, $args, $defaults );
    159 }
    160 
    161 /**
    162  * Register a screen function for an item in the main nav array.
    163  *
    164  * @since BuddyPress (2.4.0)
    165  *
    166  * @param array $args {
    167  *     Array describing the new nav item.
    168  *     @type string      $name                    Display name for the nav item.
    169  *     @type string      $slug                    Unique URL slug for the nav item.
    170  *     @type bool|string $item_css_id             Optional. 'id' attribute for the nav item. Default: the value of `$slug`.
    171  *     @type bool        $show_for_displayed_user Optional. Whether the nav item should be visible when viewing a
    172  *                                                member profile other than your own. Default: true.
    173  *     @type bool        $site_admin_only         Optional. Whether the nav item should be visible only to site admins
    174  *                                                (those with the 'bp_moderate' cap). Default: false.
    175  *     @type int         $position                Optional. Numerical index specifying where the item should appear in
    176  *                                                the nav array. Default: 99.
    177  *     @type callable    $screen_function         The callback function that will run when the nav item is clicked.
    178  *     @type bool|string $default_subnav_slug     Optional. The slug of the default subnav item to select when the nav
    179  *                                                item is clicked.
    180  * }
    181  * @return bool|null Returns false on failure.
    182  */
    183 function bp_core_register_nav_screen_function( $args = '' ) {
    184         $bp = buddypress();
    185 
    186         $defaults = array(
    187                 'name'                    => false, // Display name for the nav item
    188                 'slug'                    => false, // URL slug for the nav item
    189                 'item_css_id'             => false, // The CSS ID to apply to the HTML of the nav item
    190                 'show_for_displayed_user' => true,  // When viewing another user does this nav item show up?
    191                 'site_admin_only'         => false, // Can only site admins see this nav item?
    192                 'position'                => 99,    // Index of where this nav item should be positioned
    193                 'screen_function'         => false, // The name of the function to run when clicked
    194                 'default_subnav_slug'     => false  // The slug of the default subnav item to select when clicked
    195         );
    196 
    197         $r = wp_parse_args( $args, $defaults );
    198 
    199199        // If we don't have the required info we need, don't register this screen function.
    200200        if ( empty( $r['slug'] ) ) {
     
    250250                                 * @since BuddyPress (1.5.0)
    251251                                 *
    252                                  * @param string $default_subnav_slug The slug of the default subnav item
    253                                  *                                    to select when clicked.
    254                                  * @param array  $r                   Parsed arguments for the nav item.
     252                                 * @param string $value The slug of the default subnav item
     253                                 *                      to select when clicked.
     254                                 * @param array  $r     Parsed arguments for the nav item.
    255255                                 */
    256256                                $bp->current_action = apply_filters( 'bp_default_component_subnav', $r['default_subnav_slug'], $r );
     
    275275 * Modify the default subnav item that loads when a top level nav item is clicked.
    276276 *
    277  * @param array $args {
     277 * @param array|string $args {
    278278 *     @type string   $parent_slug     The slug of the nav item whose default is being changed.
    279279 *     @type callable $screen_function The new default callback function that will run when the nav item is clicked.
     
    379379 * Add a subnav item to the BuddyPress navigation.
    380380 *
    381  * @param array $args {
     381 * @param array|string $args {
    382382 *     Array describing the new subnav item.
    383383 *     @type string      $name              Display name for the subnav item.
     
    423423 * Add a subnav link to the BuddyPress navigation.
    424424 *
    425  * @param array $args {
     425 * @param array|string $args {
    426426 *     Array describing the new subnav item.
    427  *     @type string $name Display name for the subnav item.
    428  *     @type string $slug Unique URL slug for the subnav item.
    429  *     @type string $parent_slug Slug of the top-level nav item under which the
    430  *           new subnav item should be added.
    431  *     @type string $parent_url URL of the parent nav item.
    432  *     @type bool|string $item_css_id Optional. 'id' attribute for the nav
    433  *           item. Default: the value of $slug.
    434  *     @type bool $user_has_access Optional. True if the logged-in user has
    435  *           access to the subnav item, otherwise false. Can be set dynamically
    436  *           when registering the subnav; eg, use bp_is_my_profile() to restrict
    437  *           access to profile owners only. Default: true.
    438  *     @type bool $site_admin_only Optional. Whether the nav item should be
    439  *           visible only to site admins (those with the 'bp_moderate' cap).
    440  *           Default: false.
    441  *     @type int $position Optional. Numerical index specifying where the item
    442  *           should appear in the subnav array. Default: 90.
    443  *     @type callable $screen_function The callback function that will run
    444  *           when the nav item is clicked.
    445  *     @type string $link Optional. The URL that the subnav item should point
    446  *           to. Defaults to a value generated from the $parent_url + $slug.
    447  *     @type bool $show_in_admin_bar Optional. Whether the nav item should be
    448  *           added into the group's "Edit" Admin Bar menu for group admins.
    449  *           Default: false.
     427 *     @type string      $name              Display name for the subnav item.
     428 *     @type string      $slug              Unique URL slug for the subnav item.
     429 *     @type string      $parent_slug      Slug of the top-level nav item under which the
     430 *                                          new subnav item should be added.
     431 *     @type string      $parent_url        URL of the parent nav item.
     432 *     @type bool|string $item_css_id       Optional. 'id' attribute for the nav
     433 *                                          item. Default: the value of $slug.
     434 *     @type bool        $user_has_access   Optional. True if the logged-in user has access to the
     435 *                                         subnav item, otherwise false. Can be set dynamically
     436 *                                          when registering the subnav; eg, use bp_is_my_profile()
     437 *                                          to restrict access to profile owners only. Default: true.
     438 *     @type bool        $site_admin_only   Optional. Whether the nav item should be visible only
     439 *                                         to site admins (those with the 'bp_moderate' cap).
     440 *                                          Default: false.
     441 *     @type int         $position          Optional. Numerical index specifying where the item
     442 *                                          should appear in the subnav array. Default: 90.
     443 *     @type callable    $screen_function  The callback function that will run
     444 *                                          when the nav item is clicked.
     445 *     @type string      $link              Optional. The URL that the subnav item should point
     446 *                                          to. Defaults to a value generated from the $parent_url + $slug.
     447 *     @type bool        $show_in_admin_bar Optional. Whether the nav item should be added into
     448 *                                         the group's "Edit" Admin Bar menu for group admins.
     449 *                                          Default: false.
    450450 * }
     451 *
    451452 * @return bool|null Returns false on failure.
    452453 */
     
    510511 * Register a screen function, whether or not a related subnav link exists.
    511512 *
    512  * @param array $args {
     513 * @param array|string $args {
    513514 *     Array describing the new subnav item.
    514  *     @type string $slug Unique URL slug for the subnav item.
    515  *     @type string $parent_slug Slug of the top-level nav item under which the
    516  *           new subnav item should be added.
    517  *     @type string $parent_url URL of the parent nav item.
    518  *     @type bool $user_has_access Optional. True if the logged-in user has
    519  *           access to the subnav item, otherwise false. Can be set dynamically
    520  *           when registering the subnav; eg, use bp_is_my_profile() to restrict
    521  *           access to profile owners only. Default: true.
    522  *     @type bool $site_admin_only Optional. Whether the nav item should be
    523  *           visible only to site admins (those with the 'bp_moderate' cap).
    524  *           Default: false.
    525  *     @type int $position Optional. Numerical index specifying where the item
    526  *           should appear in the subnav array. Default: 90.
    527  *     @type callable $screen_function The callback function that will run
    528  *           when the nav item is clicked.
    529  *     @type string $link Optional. The URL that the subnav item should point
    530  *           to. Defaults to a value generated from the $parent_url + $slug.
    531  *     @type bool $show_in_admin_bar Optional. Whether the nav item should be
    532  *           added into the group's "Edit" Admin Bar menu for group admins.
    533  *           Default: false.
     515 *     @type string   $slug              Unique URL slug for the subnav item.
     516 *     @type string   $parent_slug      Slug of the top-level nav item under which the
     517 *                                       new subnav item should be added.
     518 *     @type string   $parent_url        URL of the parent nav item.
     519 *     @type bool     $user_has_access   Optional. True if the logged-in user has access to the
     520 *                                       subnav item, otherwise false. Can be set dynamically
     521 *                                       when registering the subnav; eg, use bp_is_my_profile()
     522 *                                       to restrict access to profile owners only. Default: true.
     523 *     @type bool     $site_admin_only   Optional. Whether the nav item should be visible
     524 *                                       only to site admins (those with the 'bp_moderate' cap).
     525 *                                       Default: false.
     526 *     @type int      $position          Optional. Numerical index specifying where the item
     527 *                                       should appear in the subnav array. Default: 90.
     528 *     @type callable $screen_function   The callback function that will run
     529 *                                       when the nav item is clicked.
     530 *     @type string   $link              Optional. The URL that the subnav item should point to.
     531 *                                       Defaults to a value generated from the $parent_url + $slug.
     532 *     @type bool     $show_in_admin_bar Optional. Whether the nav item should be added into
     533 *                                       the group's "Edit" Admin Bar menu for group admins.
     534 *                                       Default: false.
    534535 * }
     536 *
    535537 * @return bool|null Returns false on failure.
    536538 */
     
    592594 *
    593595 * @param array $subnav_item The subnav array added to bp_options_nav in `bp_core_new_subnav_item()`.
     596 *
    594597 * @return array
    595598 */
     
    724727 * @param string $nav_item The slug of the top-level nav item whose subnav items you're checking.
    725728 *                         Default: the current component slug.
     729 *
    726730 * @return bool $has_subnav True if the nav item is found and has subnav items; false otherwise.
    727731 */
     
    749753 *
    750754 * @param int $parent_id The slug of the parent navigation item.
    751  * @param bool Returns false on failure, ie if the nav item can't be found.
     755 *
     756 * @return bool Returns false on failure, ie if the nav item can't be found.
    752757 */
    753758function bp_core_remove_nav_item( $parent_id ) {
     
    823828 * @param string $context Context of this preference check. 'admin' or 'front'.
    824829 * @param int    $user    Optional. ID of the user to check. Default: 0 (which falls back to the logged-in user's ID).
     830 *
    825831 * @return bool True if the toolbar should be showing for this user.
    826832 */
  • trunk/src/bp-core/bp-core-cache.php

    r9819 r10012  
    1717 * When wp-super-cache is installed this function will clear cached pages
    1818 * so that success/error messages are not cached, or time sensitive content.
     19 *
     20 * @return int
    1921 */
    2022function bp_core_clear_cache() {
     
    3537/**
    3638 * Clear all cached objects for a user, or those that a user is part of.
     39 *
     40 * @param string $user_id
    3741 */
    3842function bp_core_clear_user_object_cache( $user_id ) {
     
    126130 * @since BuddyPress (2.0.0)
    127131 *
    128  * @param array $item_ids ID list.
     132 * @param array  $item_ids    ID list.
    129133 * @param string $cache_group The cache group to check against.
     134 *
    130135 * @return array
    131136 */
     
    154159 * @since BuddyPress (1.6.0)
    155160 *
    156  * @global $wpdb WordPress database object for queries..
     161 * @global object $wpdb WordPress database object for queries..
    157162 *
    158163 * @param array $args {
    159164 *     Array of arguments.
    160  *     @type array|string $object_ids List of object IDs to fetch metadata for.
    161  *           Accepts an array or a comma-separated list of numeric IDs.
    162  *     @type string $object_type The type of object, eg 'groups' or 'activity'.
    163  *     @type string $meta_table The name of the metadata table being queried.
    164  *     @type string $object_column Optional. The name of the database column
    165  *           where IDs (those provided by $object_ids) are found. Eg, 'group_id'
    166  *           for the groups metadata tables. Default: $object_type . '_id'.
    167  *     @type string $cache_key_prefix Optional. The prefix to use when creating
    168  *           cache key names. Default: the value of $meta_table.
     165 *     @type array|string $object_ids       List of object IDs to fetch metadata for.
     166 *                                          Accepts an array or a comma-separated list of numeric IDs.
     167 *     @type string       $object_type      The type of object, eg 'groups' or 'activity'.
     168 *     @type string       $meta_table      The name of the metadata table being queried.
     169 *     @type string       $object_column    Optional. The name of the database column where IDs
     170 *                                         (those provided by $object_ids) are found. Eg, 'group_id'
     171 *                                          for the groups metadata tables. Default: $object_type . '_id'.
     172 *     @type string       $cache_key_prefix Optional. The prefix to use when creating
     173 *                                          cache key names. Default: the value of $meta_table.
    169174 * }
     175 *
    170176 * @return array|bool Metadata cache for the specified objects, or false on failure.
    171177 */
     
    180186                'object_column'    => '',      // DB column for the object ids (group_id, etc)
    181187                'cache_key_prefix' => ''       // Prefix to use when creating cache key names. Eg
    182                                                //    'bp_groups_groupmeta'
     188                                                           // 'bp_groups_groupmeta'
    183189        );
    184190        $r = wp_parse_args( $args, $defaults );
  • trunk/src/bp-core/bp-core-caps.php

    r9957 r10012  
    1212
    1313/**
    14  * Return an array of roles from the currently loaded blog
     14 * Return an array of roles from the currently loaded blog.
    1515 *
    1616 * WordPress roles are dynamically flipped when calls to switch_to_blog() and
     
    133133 *       args.
    134134 *
    135  * @param array $caps See {@link WP_User::has_cap()}.
    136  * @param string $cap See {@link WP_User::has_cap()}.
    137  * @param int $user_id See {@link WP_User::has_cap()}.
    138  * @param mixed $args See {@link WP_User::has_cap()}.
     135 * @param array  $caps    See {@link WP_User::has_cap()}.
     136 * @param string $cap     See {@link WP_User::has_cap()}.
     137 * @param int    $user_id See {@link WP_User::has_cap()}.
     138 * @param mixed  $args    See {@link WP_User::has_cap()}.
     139 *
    139140 * @return array Actual capabilities for meta capability. See {@link WP_User::has_cap()}.
    140141 */
     
    186187 *
    187188 * @param string $role The role for which you're loading caps.
     189 *
    188190 * @return array Capabilities for $role.
    189191 */
     
    273275 *     @type mixed $a,...   Optional. Extra arguments applicable to the capability check.
    274276 * }
     277 *
    275278 * @return bool True if the user has the cap for the given parameters.
    276279 */
     
    335338 * @see WP_User::has_cap()
    336339 *
    337  * @param array $allcaps The caps that WP associates with the given role.
    338  * @param array $caps The caps being tested for in WP_User::has_cap().
    339  * @param array $args Miscellaneous arguments passed to the user_has_cap filter.
     340 * @param array  $caps    The caps that WP associates with the given role.
     341 * @param string $cap     The caps being tested for in WP_User::has_cap().
     342 * @param int    $user_id ID of the user being checked against.
     343 * @param array  $args    Miscellaneous arguments passed to the user_has_cap filter.
     344 *
    340345 * @return array $allcaps The user's cap list, with 'bp_moderate' appended, if relevant.
    341346 */
  • trunk/src/bp-core/bp-core-catchuri.php

    r9914 r10012  
    370370 *
    371371 * @param array $templates Array of templates to attempt to load.
     372 *
    372373 * @return bool|null Returns false on failure.
    373374 */
     
    518519 * @since BuddyPress (1.5.0)
    519520 *
    520  * @param array $args {
    521  *     @type int $mode Specifies the destination of the redirect. 1 will
    522  *           direct to the root domain (home page), which assumes you have a
    523  *           log-in form there; 2 directs to wp-login.php. Default: 2.
    524  *     @type string $redirect The URL the user will be redirected to after
    525  *           successfully logging in. Default: the URL originally requested.
    526  *     @type string $root The root URL of the site, used in case of error or
    527  *           mode 1 redirects. Default: the value of {@link bp_get_root_domain()}.
    528  *     @type string $message An error message to display to the user on the
    529  *           log-in page. Default: "You must log in to access the page you
    530  *           requested."
     521 * @param array|string $args {
     522 *     @type int    $mode     Specifies the destination of the redirect. 1 will
     523 *                            direct to the root domain (home page), which assumes you have a
     524 *                            log-in form there; 2 directs to wp-login.php. Default: 2.
     525 *     @type string $redirect The URL the user will be redirected to after successfully
     526 *                            logging in. Default: the URL originally requested.
     527 *     @type string $root     The root URL of the site, used in case of error or mode 1 redirects.
     528 *                            Default: the value of {@link bp_get_root_domain()}.
     529 *     @type string $message  An error message to display to the user on the log-in page.
     530 *                            Default: "You must log in to access the page you requested."
    531531 * }
    532532 */
     
    606606 * @since BuddyPress (1.5.0)
    607607 *
    608  * @global $error Error message to pass to wp-login.php
     608 * @global string $error Error message to pass to wp-login.php.
    609609 */
    610610function bp_core_no_access_wp_login_error() {
     
    716716 *     Optional array of arguments.
    717717 *     @type bool $include_query_args Whether to include current URL arguments
    718  *           in the canonical URL returned from the function.
     718 *                                    in the canonical URL returned from the function.
    719719 * }
     720 *
    720721 * @return string Canonical URL for the current page.
    721722 */
  • trunk/src/bp-core/bp-core-component.php

    r9847 r10012  
    109109
    110110        /**
    111          * Metadata tables for the component (if applicable)
     111         * Metadata tables for the component (if applicable).
    112112         *
    113113         * @since BuddyPress (2.0.0)
     
    118118
    119119        /**
    120          * Global tables for the component (if applicable)
     120         * Global tables for the component (if applicable).
    121121         *
    122122         * @since BuddyPress (2.0.0)
     
    141141         * @param array  $params {
    142142         *     Additional parameters used by the component.
    143          *     @type int   $adminbar_myaccount_order Set the position for our menu under the WP Toolbar's "My Account menu"
     143         *     @type int   $adminbar_myaccount_order Set the position for our menu under the WP Toolbar's "My Account menu".
    144144         *     @type array $features                 An array of feature names. This is used to load additional files from your
    145145         *                                           component directory and for feature active checks. eg. array( 'awesome' )
     
    331331         *
    332332         * @param array $includes An array of file names, or file name chunks,
    333          *        to be parsed and then included.
     333         *                        to be parsed and then included.
    334334         */
    335335        public function includes( $includes = array() ) {
     
    455455         *      in the $sub_nav parameter array should be formatted.
    456456         *
    457          * @param array $main_nav Optional. Passed directly to
    458          *        bp_core_new_nav_item(). See that function for a description.
    459          * @param array $sub_nav Optional. Multidimensional array, each item in
    460          *        which is passed to bp_core_new_subnav_item(). See that
    461          *        function for a description.
     457         * @param array $main_nav Optional. Passed directly to bp_core_new_nav_item().
     458         *                        See that function for a description.
     459         * @param array $sub_nav  Optional. Multidimensional array, each item in
     460         *                        which is passed to bp_core_new_subnav_item(). See that
     461         *                        function for a description.
    462462         */
    463463        public function setup_nav( $main_nav = array(), $sub_nav = array() ) {
     
    490490         * @see WP_Admin_Bar::add_menu() for a description of the syntax
    491491         *      required by each item in the $wp_admin_nav parameter array.
    492          * @global obj $wp_admin_bar
    493          *
    494          * @param array $wp_admin_nav An array of nav item arguments. Each item
    495          *        in this parameter array is passed to {@link WP_Admin_Bar::add_menu()}.
    496          *        See that method for a description of the required syntax for
    497          *        each item.
     492         * @global object $wp_admin_bar
     493         *
     494         * @param array $wp_admin_nav An array of nav item arguments. Each item in this parameter
     495         *                            array is passed to {@link WP_Admin_Bar::add_menu()}.
     496         *                            See that method for a description of the required syntax for
     497         *                            each item.
    498498         */
    499499        public function setup_admin_bar( $wp_admin_nav = array() ) {
     
    747747
    748748        /**
    749          * Add any permalink structures
     749         * Add any permalink structures.
    750750         *
    751751         * @since BuddyPress (1.9)
    752752         *
    753          * @uses do_action() Calls 'bp_{@link bp_Component::name}_add_permastruct'
     753         * @uses do_action() Calls 'bp_{@link bp_Component::name}_add_permastruct'.
    754754         */
    755755        public function add_permastructs() {
     
    766766
    767767        /**
    768          * Allow components to parse the main query
     768         * Allow components to parse the main query.
    769769         *
    770770         * @since BuddyPress (1.9)
    771771         *
    772772         * @uses do_action() Calls 'bp_{@link bp_Component::name}_parse_query'
    773          * @param object The main WP_Query
     773         * @param object $query The main WP_Query.
    774774         */
    775775        public function parse_query( $query ) {
     
    788788
    789789        /**
    790          * Generate any additional rewrite rules
     790         * Generate any additional rewrite rules.
    791791         *
    792792         * @since BuddyPress (1.5)
    793793         *
    794          * @uses do_action() Calls 'bp_{@link bp_Component::name}_generate_rewrite_rules'
     794         * @uses do_action() Calls 'bp_{@link bp_Component::name}_generate_rewrite_rules'.
    795795         */
    796796        public function generate_rewrite_rules() {
  • trunk/src/bp-core/bp-core-cssjs.php

    r9819 r10012  
    121121
    122122/**
    123  * Enqueues the css and js required by the Avatar UI
     123 * Enqueues the css and js required by the Avatar UI.
    124124 *
    125125 * @since  BuddyPress (2.3.0)
     
    316316 * @since BuddyPress (2.0.0)
    317317 *
    318  * @uses apply_filters() to allow other component to load extra dependencies
     318 * @uses apply_filters() to allow other component to load extra dependencies.
    319319 *
    320320 * @return array The JavaScript dependencies.
  • trunk/src/bp-core/bp-core-dependency.php

    r9819 r10012  
    488488 *
    489489 * @param array $query_vars See {@link WP::parse_request()}.
     490 *
    490491 * @return array $query_vars See {@link WP::parse_request()}.
    491492 */
     
    507508 * @since BuddyPress (1.7.0)
    508509 *
    509  * @param string $redirect_to See 'login_redirect'.
     510 * @param string $redirect_to     See 'login_redirect'.
    510511 * @param string $redirect_to_raw See 'login_redirect'.
     512 *
    511513 * @param bool   $user See 'login_redirect'.
    512514 *
     
    537539 *
    538540 * @param string $template See 'template_include'.
     541 *
    539542 * @return string Template file to use.
    540543 */
     
    580583 *
    581584 * @uses apply_filters() Calls 'bp_allowed_themes' with the allowed themes list.
     585 *
     586 * @param array $themes
     587 *
     588 * @return array
    582589 */
    583590function bp_allowed_themes( $themes ) {
     
    596603
    597604/**
    598  * The main action used for handling theme-side POST requests
     605 * The main action used for handling theme-side POST requests.
    599606 *
    600607 * @since BuddyPress (1.9.0)
     
    639646
    640647/**
    641  * The main action used for handling theme-side GET requests
     648 * The main action used for handling theme-side GET requests.
    642649 *
    643650 * @since BuddyPress (1.9.0)
  • trunk/src/bp-core/bp-core-filters.php

    r9848 r10012  
    7575 *
    7676 * @param array $pages List of excluded page IDs, as passed to the
    77  *        'wp_list_pages_excludes' filter.
     77 *                     'wp_list_pages_excludes' filter.
     78 *
    7879 * @return array The exclude list, with BP's pages added.
    7980 */
     
    114115 * @uses buddypress() gets BuddyPress main instance
    115116 *
    116  * @param object $object The post type object used in the meta box
    117  * @return object The $object, with a query argument to remove register and activate pages id.
     117 * @param object|null $object The post type object used in the meta box.
     118 *
     119 * @return object|null The $object, with a query argument to remove register and activate pages id.
    118120 */
    119121function bp_core_exclude_pages_from_nav_menu_admin( $object = null ) {
     
    157159 * @since BuddyPress (2.2.0)
    158160 *
    159  * @param array   $retval CSS classes for the current menu page in the menu
    160  * @param WP_Post $page   The page properties for the current menu item
     161 * @param array   $retval CSS classes for the current menu page in the menu.
     162 * @param WP_Post $page   The page properties for the current menu item.
     163 *
    161164 * @return array
    162165 */
     
    214217 * @since BuddyPress (2.2.0)
    215218 *
    216  * @param array   $retval CSS classes for the current nav menu item in the menu
    217  * @param WP_Post $item   The properties for the current nav menu item
     219 * @param array   $retval CSS classes for the current nav menu item in the menu.
     220 * @param WP_Post $item   The properties for the current nav menu item.
     221 *
    218222 * @return array
    219223 */
     
    258262 *
    259263 * @param array $comments The array of comments supplied to the comments template.
    260  * @param int $post->ID The post ID.
     264 * @param int   $post_id  The post ID.
     265 *
    261266 * @return array $comments The modified comment array.
    262267 */
     
    297302 *       are redirected to on login.
    298303 *
    299  * @param string $redirect_to The URL to be redirected to, sanitized
    300  *        in wp-login.php.
    301  * @param string $redirect_to_raw The unsanitized redirect_to URL ($_REQUEST['redirect_to'])
    302  * @param WP_User $user The WP_User object corresponding to a successfully
    303  *        logged-in user. Otherwise a WP_Error object.
     304 * @param string  $redirect_to     The URL to be redirected to, sanitized in wp-login.php.
     305 * @param string  $redirect_to_raw The unsanitized redirect_to URL ($_REQUEST['redirect_to']).
     306 * @param WP_User $user            The WP_User object corresponding to a successfully
     307 *                                 logged-in user. Otherwise a WP_Error object.
     308 *
    304309 * @return string The redirect URL.
    305310 */
     
    323328         * @since BuddyPress (1.6.0)
    324329         *
    325     * @param bool    $value           Whether or not to redirect.
     330  * @param bool    $value           Whether or not to redirect.
    326331         * @param string  $redirect_to     Sanitized URL to be redirected to.
    327332         * @param string  $redirect_to_raw Unsanitized URL to be redirected to.
     
    366371 *
    367372 * @param string $welcome_email Complete email passed through WordPress.
     373 *
    368374 * @return string Filtered $welcome_email with the password replaced
    369  *         by '[User Set]'.
     375 *                by '[User Set]'.
    370376 */
    371377function bp_core_filter_user_welcome_email( $welcome_email ) {
     
    400406 *
    401407 * @param string $welcome_email Complete email passed through WordPress.
    402  * @param int $blog_id ID of the blog user is joining.
    403  * @param int $user_id ID of the user joining.
    404  * @param string $password Password of user.
     408 * @param int    $blog_id       ID of the blog user is joining.
     409 * @param int    $user_id       ID of the user joining.
     410 * @param string $password      Password of user.
     411 *
    405412 * @return string Filtered $welcome_email with $password replaced by '[User Set]'.
    406413 */
     
    429436 * @see wpmu_signup_blog_notification() for a description of parameters.
    430437 *
    431  * @param string $domain The new blog domain.
    432  * @param string $path The new blog path.
    433  * @param string $title The site title.
    434  * @param string $user The user's login name.
     438 * @param string $domain     The new blog domain.
     439 * @param string $path       The new blog path.
     440 * @param string $title      The site title.
     441 * @param string $user       The user's login name.
    435442 * @param string $user_email The user's email address.
    436  * @param string $key The activation key created in wpmu_signup_blog()
    437  * @param array $meta By default, contains the requested privacy setting and
    438  *        lang_id.
     443 * @param string $key        The activation key created in wpmu_signup_blog()
     444 * @param array  $meta       By default, contains the requested privacy setting and
     445 *                           lang_id.
     446 *
    439447 * @return bool True on success, false on failure.
    440448 */
     
    511519         * @param string $subject     Subject used in the notification email.
    512520         * @param string $message     Message used in the notification email.
    513          * @param string domain       The new blog domain.
     521         * @param string $domain      The new blog domain.
    514522         * @param string $path        The new blog path.
    515523         * @param string $title       The site title.
     
    531539 * @see wpmu_signup_user_notification() for a full description of params.
    532540 *
    533  * @param string $user The user's login name.
     541 * @param string $user       The user's login name.
    534542 * @param string $user_email The user's email address.
    535  * @param string $key The activation key created in wpmu_signup_user()
    536  * @param array $meta By default, an empty array.
    537  * @return bool True on success, false on failure.
     543 * @param string $key        The activation key created in wpmu_signup_user()
     544 * @param array  $meta       By default, an empty array.
     545 *
     546 * @return bool|string True on success, false on failure.
    538547 */
    539548function bp_core_activation_signup_user_notification( $user, $user_email, $key, $meta ) {
     
    825834 *
    826835 * @param  string $title_part
     836 *
    827837 * @return string
    828838 */
     
    842852 *
    843853 * @param WP_Post $menu_item The menu item.
    844  * @return obj The modified WP_Post object.
     854 *
     855 * @return WP_Post The modified WP_Post object.
    845856 */
    846857function bp_setup_nav_menu_item( $menu_item ) {
     
    927938 *
    928939 * @param string $q SQL query.
     940 *
    929941 * @return string
    930942 */
     
    952964
    953965/**
    954  * Filter the edit post link to avoid its display in BuddyPress pages
     966 * Filter the edit post link to avoid its display in BuddyPress pages.
    955967 *
    956968 * @since BuddyPress (2.1.0)
     
    958970 * @param  string $edit_link The edit link.
    959971 * @param  int    $post_id   Post ID.
    960  * @return mixed  Will be a boolean (false) if $post_id is 0. Will be a string (the unchanged edit link)
    961  *                otherwise
     972 *
     973 * @return bool|string Will be a boolean (false) if $post_id is 0. Will be a string (the unchanged edit link)
     974 *                     otherwise
    962975 */
    963976function bp_core_filter_edit_post_link( $edit_link = '', $post_id = 0 ) {
     
    973986 * mentions suggestions?
    974987 *
    975  * @param bool $load_mentions True to load mentions assets, false otherwise.
     988 * @since BuddyPress (2.2.0)
     989 *
     990 * @param bool $load_mentions    True to load mentions assets, false otherwise.
    976991 * @param bool $mentions_enabled True if mentions are enabled.
     992 *
    977993 * @return bool True if mentions scripts should be loaded.
    978  * @since BuddyPress (2.2.0)
    979994 */
    980995function bp_maybe_load_mentions_scripts_for_blog_content( $load_mentions, $mentions_enabled ) {
  • trunk/src/bp-core/bp-core-functions.php

    r9819 r10012  
    10441044 *        the time elapsed. Enter either as an integer Unix timestamp, or as a
    10451045 *        date string of the format 'Y-m-d h:i:s'.
    1046  * @param int $newer_date Optional. Unix timestamp of date to compare older
     1046 * @param int|bool $newer_date Optional. Unix timestamp of date to compare older
    10471047 *        date to. Default: false (current time).
    10481048 * @return string String representing the time since the older date, eg
     
    14621462 * @uses apply_filters() Filter 'bp_get_user_meta_key' to modify keys individually.
    14631463 *
    1464  * @param string $key The usermeta meta_key.
     1464 * @param string|bool $key The usermeta meta_key.
    14651465 * @return string $key The usermeta meta_key.
    14661466 */
  • trunk/src/bp-core/bp-core-moderation.php

    r9819 r10012  
    2727 *
    2828 * @param int $user_id User id to check for flood.
     29 *
    2930 * @return bool True if there is no flooding, false if there is.
    3031 */
     
    5859 * @uses bp_current_user_can() Allow super admins to bypass blacklist.
    5960 *
    60  * @param int $user_id Topic or reply author ID.
    61  * @param string $title The title of the content.
     61 * @param int    $user_id Topic or reply author ID.
     62 * @param string $title   The title of the content.
    6263 * @param string $content The content being posted.
     64 *
    6365 * @return bool True if test is passed, false if fail.
    6466 */
     
    192194 * @uses bp_current_user_can() Allow super admins to bypass blacklist.
    193195 *
    194  * @param int $user_id Topic or reply author ID.
    195  * @param string $title The title of the content.
     196 * @param int    $user_id Topic or reply author ID.
     197 * @param string $title   The title of the content.
    196198 * @param string $content The content being posted.
     199 *
    197200 * @return bool True if test is passed, false if fail.
    198201 */
     
    331334         * @since BuddyPress (1.6.0)
    332335         *
    333          * @param string $retval Current user's user-agent
     336         * @param string $retval Current user's user-agent.
    334337         */
    335338        return apply_filters( 'bp_core_current_user_ua', $retval );
  • trunk/src/bp-core/bp-core-options.php

    r9828 r10012  
    218218 * @since BuddyPress (1.6.0)
    219219 *
    220  * @param bool $value Optional. Default value false
    221  * @return mixed false if not overloaded, mixed if set
     220 * @param bool $value Optional. Default value false.
     221 *
     222 * @return mixed False if not overloaded, mixed if set.
    222223 */
    223224function bp_pre_get_option( $value = false ) {
     
    252253 *
    253254 * @param string $option_name The option to be retrieved.
    254  * @param string $default Optional. Default value to be returned if the option
    255  *        isn't set. See {@link get_blog_option()}.
     255 * @param string $default     Optional. Default value to be returned if the option
     256 *                            isn't set. See {@link get_blog_option()}.
     257 *
    256258 * @return mixed The value for the option.
    257259 */
     
    278280 *
    279281 * @param string $option_name The option key to be set.
    280  * @param mixed $value The value to be set.
     282 * @param mixed  $value       The value to be set.
     283 *
    281284 * @return bool True on success, false on failure.
    282285 */
     
    297300 *
    298301 * @param string $option_name The option key to be set.
    299  * @param string $value The value to be set.
     302 * @param string $value       The value to be set.
     303 *
    300304 * @return bool True on success, false on failure.
    301305 */
     
    316320 *
    317321 * @param string $option_name The option key to be deleted.
     322 *
    318323 * @return bool True on success, false on failure.
    319324 */
     
    331336 *
    332337 * @deprecated 1.6.0
     338 *
     339 * @param array $keys
     340 *
     341 * @return bool
    333342 */
    334343function bp_core_activate_site_options( $keys = array() ) {
     
    495504 *
    496505 * @param  string $option Name of the option key.
     506 *
    497507 * @return mixed Value, if found.
    498508 */
     
    522532 *
    523533 * @param bool $default Optional. Fallback value if not found in the database.
    524  *        Default: true.
     534 *                      Default: true.
     535 *
    525536 * @return bool True if profile sync is enabled, otherwise false.
    526537 */
     
    545556 *
    546557 * @param bool $default Optional. Fallback value if not found in the database.
    547  *        Default: true.
     558 *                      Default: true.
     559 *
    548560 * @return bool True if the admin bar should be hidden for logged-out users,
    549  *         otherwise false.
     561 *              otherwise false.
    550562 */
    551563function bp_hide_loggedout_adminbar( $default = true ) {
     
    569581 *
    570582 * @param bool $default Optional. Fallback value if not found in the database.
    571  *        Default: true.
     583 *                      Default: true.
     584 *
    572585 * @return bool True if avatar uploads are disabled, otherwise false.
    573586 */
     
    592605 * @since BuddyPress (2.3.0)
    593606 *
    594  * @param bool $default Optional. Fallback value if not found in the database.
    595  *                      Defaults to the value of `bp_disable_avatar_uploads()`.
     607 * @param bool|null $default Optional. Fallback value if not found in the database.
     608 *                           Defaults to the value of `bp_disable_avatar_uploads()`.
     609 *
    596610 * @return bool True if group avatar uploads are disabled, otherwise false.
    597611 */
     
    626640 *
    627641 * @param bool $default Optional. Fallback value if not found in the database.
    628  *        Default: true.
     642 *                      Default: true.
     643 *
    629644 * @return bool True if users are able to delete their own accounts, otherwise
    630  *         false.
     645 *              false.
    631646 */
    632647function bp_disable_account_deletion( $default = false ) {
     
    651666 *
    652667 * @param bool $default Optional. Fallback value if not found in the database.
    653  *        Default: false.
     668 *                      Default: false.
     669 *
    654670 * @return bool True if activity comments are disabled for blog and forum
    655  *         items, otherwise false.
     671 *              items, otherwise false.
    656672 */
    657673function bp_disable_blogforum_comments( $default = false ) {
     
    676692 *
    677693 * @param bool $default Optional. Fallback value if not found in the database.
    678  *        Default: true.
     694 *                      Default: true.
     695 *
    679696 * @return bool True if group creation is restricted, otherwise false.
    680697 */
     
    699716 *
    700717 * @param bool $default Optional. Fallback value if not found in the database.
    701  *        Default: true.
     718 *                      Default: true.
     719 *
    702720 * @return bool True if the BuddyBar should be forced on, otherwise false.
    703721 */
     
    719737 * @since BuddyPress (1.6.0)
    720738 *
    721  * @param bool $default Optional. Default: '0'.
     739 * @param bool|string $default Optional. Default: '0'.
    722740 */
    723741function bp_group_forums_root_id( $default = '0' ) {
     
    731749         * @uses bp_get_option() To get the root forum ID from the database.
    732750         *
    733          * @param bool $default Optional. Default: '0'.
     751         * @param bool|string $default Optional. Default: '0'.
     752         *
    734753         * @return int The ID of the group forums root forum.
    735754         */
     
    754773 *
    755774 * @param bool $default Optional. Fallback value if not found in the database.
    756  *        Default: true.
     775 *                      Default: true.
     776 *
    757777 * @return bool True if group forums are active, otherwise false.
    758778 */
     
    777797 *
    778798 * @param bool $default Optional. Fallback value if not found in the database.
    779  *        Default: true.
     799 *                      Default: true.
     800 *
    780801 * @return bool True if Akismet is enabled, otherwise false.
    781802 */
     
    800821 *
    801822 * @param bool $default Optional. Fallback value if not found in the database.
    802  *        Default: true.
     823 *                      Default: true.
     824 *
    803825 * @return bool True if Heartbeat refresh is enabled, otherwise false.
    804826 */
     
    822844 * @uses get_option() To get the theme package option.
    823845 *
    824  * @param bool $default Optional. Fallback value if not found in the database.
    825  *        Default: 'legacy'.
     846 * @param string $default Optional. Fallback value if not found in the database.
     847 *                        Default: 'legacy'.
     848 *
    826849 * @return string ID of the theme package.
    827850 */
  • trunk/src/bp-core/bp-core-taxonomy.php

    r9819 r10012  
    3535 * @param string       $taxonomy  Taxonomy name.
    3636 * @param bool         $append    Optional. True to append terms to existing terms. Default: false.
     37 *
    3738 * @return array Array of term taxonomy IDs.
    3839 */
     
    6364 * @param string|array $taxonomies Name or names of taxonomies to match.
    6465 * @param array        $args       See {@see wp_get_object_terms()}.
     66 *
    6567 * @return array
    6668 */
     
    9193 * @param string|array $terms     Term or terms to remove.
    9294 * @param string       $taxonomy  Taxonomy name.
     95 *
    9396 * @return bool|WP_Error True on success, false or WP_Error on failure.
    9497 */
  • trunk/src/bp-core/bp-core-template-loader.php

    r9819 r10012  
    2424 * @uses get_template_part()
    2525 *
    26  * @param string $slug Template part slug. Used to generate filenames, eg
    27  *        'friends' for 'friends.php'.
     26 * @param string $slug Template part slug. Used to generate filenames,
     27 *                     eg 'friends' for 'friends.php'.
    2828 * @param string $name Optional. Template part name. Used to generate
    29  *        secondary filenames, eg 'personal' for 'activity-personal.php'.
     29 *                     secondary filenames, eg 'personal' for 'activity-personal.php'.
     30 *
    3031 * @return string Path to located template. See {@link bp_locate_template()}.
    3132 */
    3233function bp_get_template_part( $slug, $name = null ) {
    3334
    34         // Execute code for this part
    3535        /**
    3636         * Fires at the start of bp_get_template_part().
     
    5252        $templates[] = $slug . '.php';
    5353
    54         // Allow template parts to be filtered
    5554        /**
    5655         * Filters the template parts to be loaded.
     
    7877 *
    7978 * @param string|array $template_names Template file(s) to search for, in order.
    80  * @param bool $load Optional. If true, the template file will be loaded when
    81  *        found. If false, the path will be returned. Default: false.
    82  * @param bool $require_once Optional. Whether to require_once or require. Has
    83  *        no effect if $load is false. Default: true.
     79 * @param bool         $load           Optional. If true, the template file will be loaded when
     80 *                                     found. If false, the path will be returned. Default: false.
     81 * @param bool         $require_once   Optional. Whether to require_once or require. Has
     82 *                                     no effect if $load is false. Default: true.
     83 *
    8484 * @return string The template filename if one is located.
    8585 */
     
    146146 *
    147147 * @param string $location_callback Callback function that returns the stack location.
    148  * @param int $priority Optional. The priority parameter as passed to
    149  *        add_filter(). Default: 10.
     148 * @param int    $priority          Optional. The priority parameter as passed to
     149 *                                  add_filter(). Default: 10.
     150 *
    150151 * @return bool See {@link add_filter()}.
    151152 */
     
    169170 *
    170171 * @param string $location_callback Callback function that returns the stack location.
    171  * @param int $priority Optional. The priority parameter passed to
    172  *        {@link bp_register_template_stack()}. Default: 10.
     172 * @param int    $priority          Optional. The priority parameter passed to
     173 *                                  {@link bp_register_template_stack()}. Default: 10.
     174 *
    173175 * @return bool See {@link remove_filter()}.
    174176 */
     
    194196 * @since BuddyPress (1.7.0)
    195197 *
    196  * @global array $wp_filter Stores all of the filters.
    197  * @global array $merged_filters Merges the filter hooks using this function..
    198  * @global array $wp_current_filter stores the list of current filters with
    199  *         the current one last.
     198 * @global array $wp_filter         Stores all of the filters.
     199 * @global array $merged_filters    Merges the filter hooks using this function.
     200 * @global array $wp_current_filter Stores the list of current filters with
     201 *                                  the current one last.
     202 *
    200203 * @return array The filtered value after all hooked functions are applied to it.
    201204 */
     
    254257 * @param string $slug See {@link bp_get_template_part()}.
    255258 * @param string $name See {@link bp_get_template_part()}.
    256  * @param bool $echo If true, template content will be echoed. If false,
    257  *        returned. Default: true.
     259 * @param bool   $echo If true, template content will be echoed. If false,
     260 *                     returned. Default: true.
     261 *
    258262 * @return string|null If $echo, returns the template content.
    259263 */
     
    294298 * @uses bp_set_theme_compat_template()
    295299 *
    296  * @param string $type Filename without extension.
    297  * @param array $templates An optional list of template candidates.
     300 * @param string $type      Filename without extension.
     301 * @param array  $templates An optional list of template candidates.
     302 *
    298303 * @return string Full path to file.
    299304 */
     
    337342
    338343/**
    339  * Get the possible subdirectories to check for templates in
    340  *
    341  * @since BuddyPress (1.7.0)
    342  * @param array $templates Templates we are looking for
    343  * @return array Possible subfolders to look in
     344 * Get the possible subdirectories to check for templates in.
     345 *
     346 * @since BuddyPress (1.7.0)
     347 *
     348 * @param array $templates Templates we are looking for.
     349 *
     350 * @return array Possible subfolders to look in.
    344351 */
    345352function bp_get_template_locations( $templates = array() ) {
     
    367374 *
    368375 * @param array $stacks Array of template locations.
     376 *
    369377 * @return array() Array of all template locations registered so far.
    370378 */
     
    434442 * Listens to the 'template_include' filter and waits for any BuddyPress specific
    435443 * template condition to be met. If one is met and the template file exists,
    436  * it will be used; otherwise
     444 * it will be used; otherwise.
    437445 *
    438446 * Note that the _edit() checks are ahead of their counterparts, to prevent them
     
    442450 *
    443451 * @param string $template
     452 *
    444453 * @return string The path to the template file that is being used.
    445454 */
     
    478487 *
    479488 * @param mixed $template Default: false.
     489 *
    480490 * @return mixed False if empty. Template name if template included.
    481491 */
     
    490500 *
    491501 * @since BuddyPress (1.8.0)
     502 *
    492503 * @return bool True if yes, false if no.
    493504 */
  • trunk/src/bp-core/bp-core-template.php

    r9989 r10012  
    2626 * @uses bp_get_user_nav() Renders the navigation for a profile of a currently
    2727 *       viewed user.
     28 *
     29 * @param string $parent_slug
     30 *
     31 * @return string
    2832 */
    2933function bp_get_options_nav( $parent_slug = '' ) {
     
    111115 * @since BuddyPress (2.0.0)
    112116 *
     117 * @param string $component
     118 *
    113119 * @return string
    114120 */
     
    335341 * @since BuddyPress (1.1.0)
    336342 *
    337  * @param int  $time         The UNIX timestamp to be formatted.
     343 * @param int|string  $time         The UNIX timestamp to be formatted.
    338344 * @param bool $exclude_time Optional. True to return only the month + day, false
    339345 *                           to return month, day, and time. Default: false.
     
    702708 * @see bp_get_button()
    703709 *
    704  * @param array $args See {@link BP_Button}.
     710 * @param array|string $args See {@link BP_Button}.
    705711 */
    706712function bp_button( $args = '' ) {
     
    712718         * @see BP_Button for a description of arguments and return value.
    713719         *
    714          * @param array $args See {@link BP_Button}.
     720         * @param array|string $args See {@link BP_Button}.
    715721         * @return string HTML markup for the button.
    716722         */
     
    11081114 * WordPress theme without coping the functions from functions.php.
    11091115 *
    1110  * @param string $object
     1116 * @param string|bool $object
    11111117 * @return string The AJAX querystring.
    11121118 */
     
    11781184 * Return the name of the current item.
    11791185 *
    1180  * @return unknown
     1186 * @return string|bool
    11811187 */
    11821188function bp_current_item() {
     
    14231429                 * @since BuddyPress (1.5.0)
    14241430                 *
    1425                  * @param string BP_SEARCH_SLUG The search slug. Default "search".
     1431                 * @const string BP_SEARCH_SLUG The search slug. Default "search".
    14261432                 */
    14271433                return apply_filters( 'bp_get_search_slug', BP_SEARCH_SLUG );
     
    15971603 *
    15981604 * @param string $action_variable The action_variable being tested against.
    1599  * @param int $position Optional. The array key you're testing against. If you
     1605 * @param int|bool $position Optional. The array key you're testing against. If you
    16001606 *        don't provide a $position, the function will return true if the
    16011607 *        $action_variable is found *anywhere* in the action variables array.
     
    17551761 * already deprecated functions.
    17561762 *
     1763 * @param string $component_name
     1764 *
    17571765 * @return bool True if root component, else false.
    17581766 */
     
    17931801 * @since BuddyPress (1.5.0)
    17941802 *
    1795  * @global $current_blog WordPress global for the current blog.
     1803 * @global int $current_blog WordPress global for the current blog.
    17961804 *
    17971805 * @param string $component Optional. Name of the component to check for.
     
    26922700 * Not currently used by BuddyPress.
    26932701 *
     2702 * @param string $component Current component to check for.
     2703 * @param string $callback  Callback to invoke.
     2704 *
    26942705 * @return bool
    26952706 */
     
    27242735/**
    27252736 * Customize the body class, according to the currently displayed BP content.
    2726  *
    2727  * Uses the above is_() functions to output a body class for each scenario.
    2728  *
    2729  * @param array $wp_classes The body classes coming from WP.
    2730  * @param array $custom_classes Classes that were passed to get_body_class().
    2731  * @return array $classes The BP-adjusted body classes.
    27322737 */
    27332738function bp_the_body_class() {
    27342739        echo bp_get_the_body_class();
    27352740}
     2741        /**
     2742         * Customize the body class, according to the currently displayed BP content.
     2743         *
     2744         * Uses the above is_() functions to output a body class for each scenario.
     2745         *
     2746         * @param array $wp_classes The body classes coming from WP.
     2747         * @param array|bool $custom_classes Classes that were passed to get_body_class().
     2748         * @return array $classes The BP-adjusted body classes.
     2749         */
    27362750        function bp_get_the_body_class( $wp_classes = array(), $custom_classes = false ) {
    27372751
  • trunk/src/bp-core/bp-core-theme-compatibility.php

    r9819 r10012  
    3939 * @param array $properties {
    4040 *     An array of properties describing the theme compat package.
    41  *     @type string $id ID of the package. Must be unique.
    42  *     @type string $name Name of the theme. This should match the name given
    43  *           in style.css.
     41 *     @type string $id      ID of the package. Must be unique.
     42 *     @type string $name    Name of the theme. This should match the name given
     43 *                           in style.css.
    4444 *     @type string $version Theme version. Used for busting script and style
    45  *           browser caches.
    46  *     @type string $dir Filesystem path of the theme.
    47  *     @type string $url Base URL of the theme.
     45 *                           browser caches.
     46 *     @type string $dir     Filesystem path of the theme.
     47 *     @type string $url     Base URL of the theme.
    4848 * }
    4949 */
     
    6161         *
    6262         * @since BuddyPress (1.7.0)
     63         *
     64         * @param array $properties Array of properties for BP_Theme_Compat.
    6365         */
    6466        public function __construct( Array $properties = array() ) {
     
    110112         *
    111113         * @param string $property Property name.
    112          * @param mixed $value Property value.
     114         * @param mixed  $value    Property value.
     115         *
    113116         * @return bool True on success, false on failure.
    114117         */
     
    123126         *
    124127         * @param string $property Property name.
     128         *
    125129         * @return mixed The value of the property if it exists, otherwise an
    126          *         empty string.
     130         *               empty string.
    127131         */
    128132        public function __get( $property ) {
     
    370374 *
    371375 * @param bool $set True to set the flag to true, false to set it to false.
     376 *
    372377 * @return bool Returns the value of $set.
    373378 */
     
    387392 *
    388393 * @param array $templates The template stack.
     394 *
    389395 * @return array The template stack (value of $templates).
    390396 */
     
    404410 *
    405411 * @param string $template The template currently in use.
     412 *
    406413 * @return string The template currently in use (value of $template).
    407414 */
     
    421428 *
    422429 * @param string $template The template originally selected by WP.
     430 *
    423431 * @return string The template originally selected by WP (value of $template).
    424432 */
     
    435443 *
    436444 * @param string $template The template name to check.
     445 *
    437446 * @return bool True if the value of $template is the same as the
    438  *         "original_template" originally selected by WP. Otherwise false.
     447 *              "original_template" originally selected by WP. Otherwise false.
    439448 */
    440449function bp_is_theme_compat_original_template( $template = '' ) {
     
    458467 * @see BP_Theme_Compat for a description of the $theme parameter arguments.
    459468 *
    460  * @param array $theme See {@link BP_Theme_Compat}.
    461  * @param bool $override If true, overrides whatever package is currently set.
    462  *        Default: true.
     469 * @param array $theme    See {@link BP_Theme_Compat}.
     470 * @param bool  $override If true, overrides whatever package is currently set.
     471 *                        Default: true.
    463472 */
    464473function bp_register_theme_package( $theme = array(), $override = true ) {
     
    497506 * @global object $post Current post object.
    498507 *
    499  * @param array $args Array of optional arguments. Arguments parallel the
    500  *        properties of {@link WP_Post}; see that class for more details.
     508 * @param array $args Array of optional arguments. Arguments parallel the properties
     509 *                    of {@link WP_Post}; see that class for more details.
    501510 */
    502511function bp_theme_compat_reset_post( $args = array() ) {
     
    635644 *
    636645 * @param string $template Template name.
     646 *
    637647 * @return string $template Template name.
    638648 */
     
    708718 *
    709719 * @param string $content Original post content.
     720 *
    710721 * @return string $content Post content, potentially modified.
    711722 */
     
    753764 *
    754765 * @return bool True if the_content is currently in the process of being
    755  *         filtered and replaced.
     766 *              filtered and replaced.
    756767 */
    757768function bp_do_theme_compat() {
     
    772783 * @global array $merged_filters
    773784 *
    774  * @param string $tag The filter tag to remove filters from.
    775  * @param int $priority Optional. If present, only those callbacks attached
    776  *        at a given priority will be removed. Otherwise, all callbacks
    777  *        attached to the tag will be removed, regardless of priority.
     785 * @param string   $tag      The filter tag to remove filters from.
     786 * @param int|bool $priority Optional. If present, only those callbacks attached
     787 *                           at a given priority will be removed. Otherwise, all callbacks
     788 *                           attached to the tag will be removed, regardless of priority.
     789 *
    778790 * @return bool True on success.
    779791 */
     
    827839 * @global array $merged_filters
    828840 *
    829  * @param string $tag The tag to which filters should be restored.
    830  * @param int $priority Optional. If present, only those filters that were
    831  *        originally attached to the tag with $priority will be restored.
    832  *        Otherwise, all available filters will be restored, regardless of
    833  *        priority.
     841 * @param string   $tag      The tag to which filters should be restored.
     842 * @param int|bool $priority Optional. If present, only those filters that were originally
     843 *                           attached to the tag with $priority will be restored. Otherwise,
     844 *                           all available filters will be restored, regardless of priority.
     845 *
    834846 * @return bool True on success.
    835847 */
     
    880892 * @since BuddyPress (1.7.0)
    881893 *
    882  * @param bool $open True if open, false if closed.
    883  * @param int $post_id ID of the post to check.
     894 * @param bool $open    True if open, false if closed.
     895 * @param int  $post_id ID of the post to check.
     896 *
    884897 * @return bool True if open, false if closed.
    885898 */
     
    917930 *
    918931 * @param string $retval The current post content.
     932 *
     933 * @return string $retval
    919934 */
    920935function bp_theme_compat_toggle_is_page( $retval = '' ) {
  • trunk/src/bp-core/bp-core-update.php

    r9849 r10012  
    6060 *
    6161 * @uses buddypress()
     62 *
     63 * @param string $basename BuddyPress basename.
    6264 *
    6365 * @return bool True if activating BuddyPress, false if not.
     
    105107 *
    106108 * @uses buddypress()
     109 *
     110 * @param string $basename BuddyPress basename.
    107111 *
    108112 * @return bool True if deactivating BuddyPress, false if not.
     
    397401 *
    398402 * - Ensure that the activity tables are installed, for last_activity storage.
    399  * - Migrate last_activity data from usermeta to activity table
    400  * - Add values for all BuddyPress options to the options table
     403 * - Migrate last_activity data from usermeta to activity table.
     404 * - Add values for all BuddyPress options to the options table.
    401405 *
    402406 * @since BuddyPress (2.0.0)
     
    429433
    430434/**
    431  * 2.0.1 database upgrade routine
     435 * 2.0.1 database upgrade routine.
    432436 *
    433437 * @since BuddyPress (2.0.1)
     
    445449 * 2.2.0 update routine.
    446450 *
    447  * - Add messages meta table
    448  * - Update the component field of the 'new members' activity type
    449  * - Clean up hidden friendship activities
     451 * - Add messages meta table.
     452 * - Update the component field of the 'new members' activity type.
     453 * - Clean up hidden friendship activities.
    450454 *
    451455 * @since BuddyPress (2.2.0)
     
    470474 * 2.3.0 update routine.
    471475 *
    472  * - Add notifications meta table
     476 * - Add notifications meta table.
    473477 *
    474478 * @since BuddyPress (2.3.0)
     
    519523
    520524/**
    521  * Remove all hidden friendship activities
     525 * Remove all hidden friendship activities.
    522526 *
    523527 * @since BuddyPress (2.2.0)
    524528 *
    525  * @uses bp_activity_delete() to delete the corresponding friendship activities
     529 * @uses bp_activity_delete() to delete the corresponding friendship activities.
    526530 */
    527531function bp_cleanup_friendship_activities() {
     
    568572 * @global WPDB $wpdb
    569573 *
    570  * @return bool If signups table exists
     574 * @return bool|null If signups table exists.
    571575 */
    572576function bp_core_maybe_install_signups() {
  • trunk/src/bp-core/bp-core-widgets.php

    r9819 r10012  
    4646         * @see WP_Widget::widget() for description of parameters.
    4747         *
    48          * @param array $args Widget arguments.
     48         * @param array $args     Widget arguments.
    4949         * @param array $instance Widget settings, as saved by the user.
    5050         */
     
    148148         * @param array $new_instance The new instance options.
    149149         * @param array $old_instance The old instance options.
     150         *
    150151         * @return array $instance The parsed options to be saved.
    151152         */
     
    160161         * Output the login widget options form.
    161162         *
    162          * @param $instance Settings for this widget.
     163         * @param array $instance Settings for this widget.
     164         *
     165         * @return string
    163166         */
    164167        public function form( $instance = array() ) {
  • trunk/src/bp-core/bp-core-wpabstraction.php

    r9819 r10012  
    1919 *
    2020 * @global string $wp_version
     21 *
    2122 * @return string $wp_version
    2223 */
     
    127128 * @todo Why is this function defined in this file?
    128129 *
    129  * @param string $prefix Global table prefix.
     130 * @param string|bool $prefix Global table prefix.
    130131 * @return string SQL chunk.
    131132 */
     
    177178         * @param string $needle String to search for.
    178179         * @param int $offset Optional. Start position for the search. Default: 0.
    179          * @param string $enc Optional. Encoding type. Ignored.
     180         * @param string $encoding Optional. Encoding type. Ignored.
    180181         * @return int|bool Position of needle in haystack if found, else false.
    181182         */
     
    201202         * @param string $needle String to search for.
    202203         * @param int $offset Optional. Start position for the search. Default: 0.
    203          * @param string $enc Optional. Encoding type. Ignored.
     204         * @param string $encoding Optional. Encoding type. Ignored.
    204205         * @return int Position of last needle in haystack if found, else false.
    205206         */
  • trunk/src/bp-core/classes/class-bp-attachment-avatar.php

    r9831 r10012  
    11<?php
    22/**
    3  * Core Avatars attachment class
     3 * Core Avatars attachment class.
    44 *
    55 * @package BuddyPress
     
    1111
    1212/**
    13  * BP Attachment Avatar class
     13 * BP Attachment Avatar class.
    1414 *
    15  * Extends BP Attachment to manage the avatar uploads
     15 * Extends BP Attachment to manage the avatar uploads.
    1616 *
    1717 * @since BuddyPress (2.3.0)
     
    2020
    2121        /**
    22          * Construct Upload parameters
     22         * Construct Upload parameters.
    2323         *
    2424         * @since BuddyPress (2.3.0)
     
    4646
    4747        /**
    48          * Gets the available avatar types
    49          *
    50          * @since BuddyPress (2.3.0)
    51          * @return string comma separated list of allowed avatar types
     48         * Gets the available avatar types.
     49         *
     50         * @since BuddyPress (2.3.0)
     51         *
     52         * @param array $allowed_types Array of allowed avatar types.
     53         *
     54         * @return string comma separated list of allowed avatar types.
    5255         */
    5356        public static function get_avatar_types( $allowed_types = array() ) {
     
    5861
    5962        /**
    60          * Set Upload Dir data for avatars
     63         * Set Upload Dir data for avatars.
    6164         *
    6265         * @since BuddyPress (2.3.0)
     
    7881
    7982        /**
    80          * Avatar specific rules
    81          *
    82          * Adds an error if the avatar size or type don't match BuddyPress needs
    83          * The error code is the index of $upload_error_strings
    84          *
    85          * @since BuddyPress (2.3.0)
    86          *
    87          * @param  array $file the temporary file attributes (before it has been moved)
     83         * Avatar specific rules.
     84         *
     85         * Adds an error if the avatar size or type don't match BuddyPress needs.
     86         * The error code is the index of $upload_error_strings.
     87         *
     88         * @since BuddyPress (2.3.0)
     89         *
    8890         * @uses   bp_core_check_avatar_size()
    8991         * @uses   bp_core_check_avatar_type()
    90          * @return array the file with extra errors if needed
     92         *
     93         * @param  array $file the temporary file attributes (before it has been moved).
     94         *
     95         * @return array the file with extra errors if needed.
    9196         */
    9297        public function validate_upload( $file = array() ) {
     
    110115
    111116        /**
    112          * Maybe shrink the attachment to fit maximum allowed width
    113          *
    114          * @since BuddyPress (2.3.0)
    115          *
    116          * @param string $file the absolute path to the file
     117         * Maybe shrink the attachment to fit maximum allowed width.
     118         *
     119         * @since BuddyPress (2.3.0)
     120         *
    117121         * @uses  bp_core_avatar_original_max_width()
    118122         * @uses  wp_get_image_editor()
     123         *
     124         * @param string $file the absolute path to the file.
     125         *
    119126         * @return mixed
    120127         */
     
    157164
    158165        /**
    159          * Check if the image dimensions are smaller than full avatar dimensions
    160          *
    161          * @since BuddyPress (2.3.0)
    162          *
    163          * @param string $file the absolute path to the file
     166         * Check if the image dimensions are smaller than full avatar dimensions.
     167         *
     168         * @since BuddyPress (2.3.0)
     169         *
    164170         * @uses  bp_core_avatar_full_width()
    165171         * @uses  bp_core_avatar_full_height()
     172         *
     173         * @param string $file the absolute path to the file.
     174         *
    166175         * @return boolean
    167176         */
     
    179188
    180189        /**
    181          * Crop the avatar
     190         * Crop the avatar.
    182191         *
    183192         * @since BuddyPress (2.3.0)
    184193         *
    185194         * @see  BP_Attachment::crop for the list of parameters
    186          * @param array $args
    187195         * @uses bp_core_fetch_avatar()
    188196         * @uses bp_core_delete_existing_avatar()
     
    191199         * @uses bp_core_avatar_dimension()
    192200         * @uses BP_Attachment::crop
    193          * @return array the cropped avatars (full and thumb)
     201         *
     202         * @param array $args
     203         *
     204         * @return array The cropped avatars (full and thumb).
    194205         */
    195206        public function crop( $args = array() ) {
     
    274285
    275286        /**
    276          * Get the user id to set its avatar
    277          *
    278          * @since BuddyPress (2.3.0)
    279          *
    280          * @return integer the user ID
     287         * Get the user id to set its avatar.
     288         *
     289         * @since BuddyPress (2.3.0)
     290         *
     291         * @return integer The user ID.
    281292         */
    282293        private function get_user_id() {
     
    296307
    297308        /**
    298          * Get the group id to set its avatar
    299          *
    300          * @since BuddyPress (2.3.0)
    301          *
    302          * @return integer the group id
     309         * Get the group id to set its avatar.
     310         *
     311         * @since BuddyPress (2.3.0)
     312         *
     313         * @return integer The group ID.
    303314         */
    304315        private function get_group_id() {
     
    313324
    314325        /**
    315          * Build script datas for the Uploader UI
    316          *
    317          * @since BuddyPress (2.3.0)
    318          *
    319          * @return array the javascript localization data
     326         * Build script datas for the Uploader UI.
     327         *
     328         * @since BuddyPress (2.3.0)
     329         *
     330         * @return array The javascript localization data.
    320331         */
    321332        public function script_data() {
     
    375386                        );
    376387                } else {
     388
    377389                        /**
    378                          * Use this filter to include specific BuddyPress params for your object
    379                          * e.g. Blavatar
     390                         * Use this filter to include specific BuddyPress params for your object.
     391                         * e.g. Blavatar.
    380392                         *
    381393                         * @since BuddyPress (2.3.0)
    382394                         *
    383                          * @param array the avatar specific BuddyPress parameters
     395                         * @param array $value The avatar specific BuddyPress parameters.
    384396                         */
    385397                        $script_data['bp_params'] = apply_filters( 'bp_attachment_avatar_params', array() );
     
    398410
    399411                /**
    400                  * Use this filter to override/extend the avatar script data
     412                 * Use this filter to override/extend the avatar script data.
    401413                 *
    402414                 * @since BuddyPress (2.3.0)
    403415                 *
    404                  * @param array  $script_data the avatar script data
    405                  * @param string $object      the object the avatar belongs to (eg: user or group)
     416                 * @param array  $script_data The avatar script data.
     417                 * @param string $object      The object the avatar belongs to (eg: user or group).
    406418                 */
    407419                return apply_filters( 'bp_attachment_avatar_script_data', $script_data, $object );
  • trunk/src/bp-core/classes/class-bp-attachment.php

    r9874 r10012  
    1111
    1212/**
    13  * BP Attachment class
     13 * BP Attachment class.
    1414 *
    1515 * Extend it to manage your component's uploads.
     
    2222
    2323        /**
    24          * The file being uploaded
     24         * The file being uploaded.
    2525         *
    2626         * @var array
     
    3030        /**
    3131         * The default args to be merged with the
    32          * ones passed by the child class
     32         * ones passed by the child class.
    3333         *
    3434         * @var array
     
    4545
    4646        /**
    47          * Construct Upload parameters
    48          *
    49          * @since BuddyPress (2.3.0)
    50          *
    51          * @param array $args {
     47         * Construct Upload parameters.
     48         *
     49         * @since BuddyPress (2.3.0)
     50         *
     51         * @param array|string $args {
    5252         *     @type int    $original_max_filesize Maximum file size in kilobytes. Defaults to php.ini settings.
    5353         *     @type array  $allowed_mime_types    List of allowed file extensions (eg: array( 'jpg', 'gif', 'png' ) ).
    54          *                                         Defaults to WordPress allowed mime types
    55          *     @type string $base_dir              Component's upload base directory. Defaults to WordPress 'uploads'
     54         *                                         Defaults to WordPress allowed mime types.
     55         *     @type string $base_dir              Component's upload base directory. Defaults to WordPress 'uploads'.
    5656         *     @type string $action                The upload action used when uploading a file, $_POST['action'] must be set
    57          *                                         and its value must equal $action {@link wp_handle_upload()} (required)
    58          *     @type string $file_input            The name attribute used in the file input. (required)
     57         *                                         and its value must equal $action {@link wp_handle_upload()} (required).
     58         *     @type string $file_input            The name attribute used in the file input. (required).
    5959         *     @type array  $upload_error_strings  A list of specific error messages (optional).
    60          *     @type array  $required_wp_files     The list of required WordPress core files. Default: array( 'file' );
     60         *     @type array  $required_wp_files     The list of required WordPress core files. Default: array( 'file' ).
    6161         * }
    6262         * @uses  sanitize_key()
     
    107107         * @since BuddyPress (2.3.0)
    108108         *
    109          * @uses  bp_upload_dir()
     109         * @uses bp_upload_dir()
    110110         */
    111111        public function set_upload_dir() {
     
    140140
    141141        /**
    142          * Set Upload error messages
     142         * Set Upload error messages.
    143143         *
    144144         * Used into the $overrides argument of BP_Attachment->upload()
     
    146146         * @since BuddyPress (2.3.0)
    147147         *
    148          * @param array $param a list of error messages to add to BuddyPress core ones
     148         * @param array $param A list of error messages to add to BuddyPress core ones.
     149         *
    149150         * @return array the list of upload errors
    150151         */
     
    176177
    177178        /**
    178          * Include the WordPress core needed files
     179         * Include the WordPress core needed files.
    179180         *
    180181         * @since BuddyPress (2.3.0)
     
    191192
    192193        /**
    193          * Upload the attachment
    194          *
    195          * @since BuddyPress (2.3.0)
    196          *
    197          * @param  array $file               The appropriate entry the from $_FILES superglobal.
    198          * @param  string $upload_dir_filter A specific filter to be applied to 'upload_dir' (optional).
    199          * @param  string $time              Optional. Time formatted in 'yyyy/mm'. Default null.
     194         * Upload the attachment.
     195         *
     196         * @since BuddyPress (2.3.0)
     197         *
     198         * @param  array       $file              The appropriate entry the from $_FILES superglobal.
     199         * @param  string      $upload_dir_filter A specific filter to be applied to 'upload_dir' (optional).
     200         * @param  string|null $time              Optional. Time formatted in 'yyyy/mm'. Default null.
     201         *
    200202         * @uses   wp_handle_upload()        To upload the file
    201203         * @uses   add_filter()              To temporarly overrides WordPress uploads data
     
    247249
    248250                /**
    249                  * If you need to add some overrides we haven't thought of
     251                 * If you need to add some overrides we haven't thought of.
    250252                 *
    251                  * @var  array $overrides the wp_handle_upload overrides
     253                 * @param array $overrides The wp_handle_upload overrides
    252254                 */
    253255                $overrides = apply_filters( 'bp_attachment_upload_overrides', $overrides );
     
    286288
    287289        /**
    288          * Validate the allowed mime types using WordPress allowed mime types
     290         * Validate the allowed mime types using WordPress allowed mime types.
    289291         *
    290292         * In case of a multisite, the mime types are already restricted by
     
    312314
    313315        /**
    314          * Specific upload rules
     316         * Specific upload rules.
    315317         *
    316318         * Override this function from your child class to build your specific rules
     
    322324         * @since BuddyPress (2.3.0)
    323325         *
    324          * @param  array $file the temporary file attributes (before it has been moved)
    325          * @return array the file
     326         * @param  array $file The temporary file attributes (before it has been moved).
     327         *
     328         * @return array The file.
    326329         */
    327330        public function validate_upload( $file = array() ) {
     
    340343
    341344        /**
    342          * Default filter to save the attachments
    343          *
    344          * @since BuddyPress (2.3.0)
    345          *
    346          * @uses   apply_filters() call 'bp_attachment_upload_dir' to eventually override the upload location
    347          *                         regarding to context
    348          * @return array the upload directory data
     345         * Default filter to save the attachments.
     346         *
     347         * @since BuddyPress (2.3.0)
     348         *
     349         * @uses apply_filters() call 'bp_attachment_upload_dir' to eventually override the upload location
     350         *       regarding to context
     351         *
     352         * @return array The upload directory data.
    349353         */
    350354        public function upload_dir_filter() {
     355
    351356                /**
    352357                 * Filters the component's upload directory.
     
    367372
    368373        /**
    369          * Create the custom base directory for the component uploads
    370          *
    371          * Override this function in your child class to run specific actions
     374         * Create the custom base directory for the component uploads.
     375         *
     376         * Override this function in your child class to run specific actions.
    372377         * (eg: add an .htaccess file)
    373378         *
    374379         * @since BuddyPress (2.3.0)
    375380         *
    376          * @uses   wp_mkdir_p()
     381         * @uses wp_mkdir_p()
    377382         */
    378383        public function create_dir() {
     
    396401
    397402        /**
    398          * Crop an image file
     403         * Crop an image file.
    399404         *
    400405         * @since BuddyPress (2.3.0)
     
    402407         * @param array $args {
    403408         *     @type string $original_file The source file (absolute path) for the Attachment.
    404          *     @type int    $crop_x The start x position to crop from.
    405          *     @type int    $crop_y The start y position to crop from.
    406          *     @type int    $crop_w The width to crop.
    407          *     @type int    $crop_h The height to crop.
    408          *     @type int    $dst_w The destination width.
    409          *     @type int    $dst_h The destination height.
    410          *     @type int    $src_abs Optional. If the source crop points are absolute.
    411          *     @type string $dst_file Optional. The destination file to write to.
     409         *     @type int    $crop_x        The start x position to crop from.
     410         *     @type int    $crop_y        The start y position to crop from.
     411         *     @type int    $crop_w        The width to crop.
     412         *     @type int    $crop_h        The height to crop.
     413         *     @type int    $dst_w         The destination width.
     414         *     @type int    $dst_h         The destination height.
     415         *     @type int    $src_abs       Optional. If the source crop points are absolute.
     416         *     @type string $dst_file      Optional. The destination file to write to.
    412417         * }
    413418         * @uses wp_crop_image()
     419         *
    414420         * @return string|WP_Error New filepath on success, WP_Error on failure.
    415421         */
     
    495501
    496502        /**
    497          * Build script datas for the Uploader UI
    498          *
    499          * Override this method from your child class to build the script datas
    500          *
    501          * @since BuddyPress (2.3.0)
    502          *
    503          * @return array the javascript localization data
     503         * Build script datas for the Uploader UI.
     504         *
     505         * Override this method from your child class to build the script datas.
     506         *
     507         * @since BuddyPress (2.3.0)
     508         *
     509         * @return array The javascript localization data.
    504510         */
    505511        public function script_data() {
  • trunk/src/bp-core/classes/class-bp-button.php

    r9819 r10012  
    1717 * @param array $args {
    1818 *     Array of arguments.
    19  *     @type string $id String describing the button type.
    20  *     @type string $component The name of the component the button belongs to.
    21  *           Default: 'core'.
    22  *     @type bool $must_be_logged_in Optional. Does the user need to be logged
    23  *           in to see this button? Default: true.
    24  *     @type bool $block_self Optional. True if the button should be hidden
    25  *           when a user is viewing his own profile. Default: true.
    26  *     @type string|bool $wrapper Optional. HTML element type that should wrap
    27  *           the button: 'div', 'span', 'p', or 'li'. False for no wrapper at
    28  *           all. Default: 'div'.
    29  *     @type string $wrapper_id Optional. DOM ID of the button wrapper element.
    30  *           Default: ''.
    31  *     @type string $wrapper_class Optional. DOM class of the button wrapper
    32  *           element. Default: ''.
    33  *     @type string $link_href Optional. Destination link of the button.
    34  *           Default: ''.
    35  *     @type string $link_class Optional. DOM class of the button. Default: ''.
    36  *     @type string $link_id Optional. DOM ID of the button. Default: ''.
    37  *     @type string $link_rel Optional. DOM 'rel' attribute of the button.
    38  *           Default: ''.
    39  *     @type string $link_title Optional. Title attribute of the button.
    40  *           Default: ''.
    41  *     @type string $link_text Optional. Text to appear on the button.
    42  *           Default: ''.
     19 *
     20 *     @type string      $id                String describing the button type.
     21 *     @type string      $component         The name of the component the button belongs to.
     22 *                                          Default: 'core'.
     23 *     @type bool        $must_be_logged_in Optional. Does the user need to be logged
     24 *                                          in to see this button? Default: true.
     25 *     @type bool        $block_self        Optional. True if the button should be hidden
     26 *                                          when a user is viewing his own profile.
     27 *                                          Default: true.
     28 *     @type string|bool $wrapper           Optional. HTML element type that should wrap
     29 *                                          the button: 'div', 'span', 'p', or 'li'.
     30 *                                          False for no wrapper at all. Default: 'div'.
     31 *     @type string      $wrapper_id        Optional. DOM ID of the button wrapper element.
     32 *                                          Default: ''.
     33 *     @type string      $wrapper_class     Optional. DOM class of the button wrapper
     34 *                                          element. Default: ''.
     35 *     @type string      $link_href         Optional. Destination link of the button.
     36 *                                          Default: ''.
     37 *     @type string      $link_class        Optional. DOM class of the button. Default: ''.
     38 *     @type string      $link_id           Optional. DOM ID of the button. Default: ''.
     39 *     @type string      $link_rel          Optional. DOM 'rel' attribute of the button.
     40 *                                          Default: ''.
     41 *     @type string      $link_title        Optional. Title attribute of the button.
     42 *                                          Default: ''.
     43 *     @type string      $link_text         Optional. Text to appear on the button.
     44 *                                          Default: ''.
    4345 * }
    4446 */
     
    153155         * @since BuddyPress (1.2.6)
    154156         *
    155          * @param array $args See {@BP_Button}.
    156          * @return bool|null Returns false when the button is not allowed for
    157          *         the current context.
     157         * @param array|string $args See {@BP_Button}.
    158158         */
    159159        public function __construct( $args = '' ) {
  • trunk/src/bp-core/classes/class-bp-core-notification.php

    r9819 r10012  
    2121
    2222        /**
    23          * The notification id
    24          *
    25          * @var integer
     23         * The notification id.
     24         *
     25         * @var int
    2626         */
    2727        public $id;
     
    3030         * The ID to which the notification relates to within the component.
    3131         *
    32          * @var integer
     32         * @var int
    3333         */
    3434        public $item_id;
     
    3737         * The secondary ID to which the notification relates to within the component.
    3838         *
    39          * @var integer
     39         * @var int
    4040         */
    4141        public $secondary_item_id = null;
     
    4444         * The user ID for who the notification is for.
    4545         *
    46          * @var integer
     46         * @var int
    4747         */
    4848        public $user_id;
     
    8181         * Constructor
    8282         *
    83          * @param integer $id
     83         * @param int $id
    8484         */
    8585        public function __construct( $id = 0 ) {
     
    9393         * Update or insert notification details into the database.
    9494         *
    95          * @global wpdb $wpdb WordPress database object
    96          * @return bool Success or failure
     95         * @global wpdb $wpdb WordPress database object.
     96         *
     97         * @return bool Success or failure.
    9798         */
    9899        public function save() {
     
    123124         * Fetches the notification data from the database.
    124125         *
    125          * @global wpdb $wpdb WordPress database object
     126         * @global wpdb $wpdb WordPress database object.
    126127         */
    127128        public function populate() {
     
    143144        /** Static Methods ********************************************************/
    144145
     146        /**
     147         * Check the access for a user.
     148         *
     149         * @param int $user_id         ID to check access for.
     150         * @param int $notification_id Notification ID to check for.
     151         *
     152         * @return string
     153         */
    145154        public static function check_access( $user_id, $notification_id ) {
    146155                global $wpdb;
     
    155164         *
    156165         * @global wpdb $wpdb WordPress database object
    157          * @param integer $user_id User ID
    158          * @param string $status 'is_new' or 'all'
     166         *
     167         * @param int    $user_id User ID.
     168         * @param string $status 'is_new' or 'all'.
     169         *
    159170         * @return array Associative array
    160171         * @static
     
    175186         * Delete all the notifications for a user based on the component name and action.
    176187         *
    177          * @global wpdb $wpdb WordPress database object
    178          * @param integer $user_id
     188         * @global wpdb $wpdb WordPress database object.
     189         *
     190         * @param int    $user_id
    179191         * @param string $component_name
    180192         * @param string $component_action
    181          * @static
     193         *
     194         * @static
     195         *
     196         * @return mixed
    182197         */
    183198        public static function delete_for_user_by_type( $user_id, $component_name, $component_action ) {
     
    192207         * Delete all the notifications that have a specific item id, component name and action.
    193208         *
    194          * @global wpdb $wpdb WordPress database object
    195          * @param integer $user_id The ID of the user who the notifications are for.
    196          * @param integer $item_id The item ID of the notifications we wish to delete.
    197          * @param string $component_name The name of the component that the notifications we wish to delete.
    198          * @param string $component_action The action of the component that the notifications we wish to delete.
    199          * @param integer $secondary_item_id (optional) The secondary item id of the notifications that we wish to use to delete.
    200          * @static
     209         * @global wpdb $wpdb WordPress database object.
     210         *
     211         * @param int      $user_id           The ID of the user who the notifications are for.
     212         * @param int      $item_id           The item ID of the notifications we wish to delete.
     213         * @param string   $component_name    The name of the component that the notifications we wish to delete.
     214         * @param string   $component_action  The action of the component that the notifications we wish to delete.
     215         * @param int|bool $secondary_item_id (optional) The secondary item id of the notifications that we wish to
     216         *                                    use to delete.
     217         * @static
     218         *
     219         * @return mixed
    201220         */
    202221        public static function delete_for_user_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false ) {
     
    215234         * Deletes all the notifications sent by a specific user, by component and action.
    216235         *
    217          * @global wpdb $wpdb WordPress database object
    218          * @param integer $user_id The ID of the user whose sent notifications we wish to delete.
    219          * @param string $component_name The name of the component the notification was sent from.
     236         * @global wpdb $wpdb WordPress database object.
     237         *
     238         * @param int    $user_id          The ID of the user whose sent notifications we wish to delete.
     239         * @param string $component_name   The name of the component the notification was sent from.
    220240         * @param string $component_action The action of the component the notification was sent from.
    221241         * @static
     242         *
     243         * @return mixed
    222244         */
    223245        public static function delete_from_user_by_type( $user_id, $component_name, $component_action ) {
     
    230252
    231253        /**
    232          * Deletes all the notifications for all users by item id, and optional secondary item id, and component name and action.
    233          *
    234          * @global wpdb $wpdb WordPress database object
    235          * @param string $item_id The item id that they notifications are to be for.
    236          * @param string $component_name The component that the notifications are to be from.
    237          * @param string $component_action The action that the notifications are to be from.
     254         * Deletes all the notifications for all users by item id, and optional secondary item id,
     255         * and component name and action.
     256         *
     257         * @global wpdb $wpdb WordPress database object.
     258         *
     259         * @param string $item_id           The item id that they notifications are to be for.
     260         * @param string $component_name    The component that the notifications are to be from.
     261         * @param string $component_action  The action that the notifications are to be from.
    238262         * @param string $secondary_item_id Optional secondary item id that the notifications are to have.
    239263         * @static
     264         *
     265         * @return mixed
    240266         */
    241267        public static function delete_all_by_type( $item_id, $component_name, $component_action, $secondary_item_id ) {
  • trunk/src/bp-core/classes/class-bp-core-user.php

    r9819 r10012  
    5454
    5555        /**
    56          * The full name of the user
     56         * The full name of the user.
    5757         *
    5858         * @var string
     
    100100
    101101        /**
    102          * The total number of blog posts posted by the user
     102         * The total number of blog posts posted by the user.
    103103         *
    104104         * @var integer
     
    129129         * Class constructor.
    130130         *
    131          * @param integer $user_id The ID for the user being queried.
    132          * @param bool $populate_extras Whether to fetch extra information
    133          *        such as group/friendship counts or not. Default: false.
     131         * @param integer $user_id         The ID for the user being queried.
     132         * @param bool    $populate_extras Whether to fetch extra information such as
     133         *                                group/friendship counts or not. Default: false.
    134134         */
    135135        public function __construct( $user_id, $populate_extras = false ) {
     
    228228         *      are used there in the same way.
    229229         *
    230          * @param string $type See {@link BP_User_Query}.
    231          * @param int $limit See {@link BP_User_Query}. Default: 0.
    232          * @param int $page See {@link BP_User_Query}. Default: 1.
    233          * @param int $user_id See {@link BP_User_Query}. Default: 0.
    234          * @param mixed $include See {@link BP_User_Query}. Default: false.
    235          * @param string|bool $search_terms See {@link BP_User_Query}.
    236          *        Default: false.
    237          * @param bool $populate_extras See {@link BP_User_Query}.
    238          *        Default: true.
    239          * @param mixed $exclude See {@link BP_User_Query}. Default: false.
    240          * @param string|bool $meta_key See {@link BP_User_Query}.
    241          *        Default: false.
    242          * @param string|bool $meta_value See {@link BP_User_Query}.
    243          *        Default: false.
     230         * @param string      $type            See {@link BP_User_Query}.
     231         * @param int         $limit          See {@link BP_User_Query}. Default: 0.
     232         * @param int         $page            See {@link BP_User_Query}. Default: 1.
     233         * @param int         $user_id        See {@link BP_User_Query}. Default: 0.
     234         * @param mixed       $include        See {@link BP_User_Query}. Default: false.
     235         * @param string|bool $search_terms    See {@link BP_User_Query}.
     236         *                                     Default: false.
     237         * @param bool        $populate_extras See {@link BP_User_Query}.
     238         *                                     Default: true.
     239         * @param mixed       $exclude        See {@link BP_User_Query}. Default: false.
     240         * @param string|bool $meta_key        See {@link BP_User_Query}.
     241         *                                     Default: false.
     242         * @param string|bool $meta_value      See {@link BP_User_Query}.
     243         *                                     Default: false.
    244244         * @return array {
    245          *     @type int $total_users Total number of users matched by query
    246          *           params.
     245         *     @type int   $total_users Total number of users matched by query
     246         *                              params.
    247247         *     @type array $paged_users The current page of users matched by
    248          *           query params.
     248         *                              query params.
    249249         * }
    250250         */
     
    444444         * @global wpdb $wpdb WordPress database object.
    445445         *
    446          * @param string $letter The letter the users names are to start with.
    447          * @param int $limit The number of users we wish to retrive.
    448          * @param int $page The page number we are currently on, used in
    449          *        conjunction with $limit to get the start position for the
    450          *        limit.
    451          * @param bool $populate_extras Populate extra user fields?
    452          * @param string $exclude Comma-separated IDs of users whose results
    453          *        aren't to be fetched.
     446         * @param string $letter          The letter the users names are to start with.
     447         * @param int    $limit          The number of users we wish to retrive.
     448         * @param int    $page            The page number we are currently on, used in conjunction
     449         *                                with $limit to get the start position for the limit.
     450         * @param bool   $populate_extras Populate extra user fields?
     451         * @param string $exclude         Comma-separated IDs of users whose results
     452         *                                aren't to be fetched.
     453         *
    454454         * @return mixed False on error, otherwise associative array of results.
    455455         */
     
    531531         *
    532532         * @global wpdb $wpdb WordPress database object.
    533          * @param array $user_ids The user IDs of the users who we wish to
    534          *        fetch information on.
    535          * @param int $limit The limit of results we want.
    536          * @param int $page The page we are on for pagination.
    537          * @param bool $populate_extras Populate extra user fields?
     533         *
     534         * @param array $user_ids        The user IDs of the users who we wish to
     535         *                               fetch information on.
     536         * @param int   $limit           The limit of results we want.
     537         * @param int   $page            The page we are on for pagination.
     538         * @param bool  $populate_extras Populate extra user fields?
     539         *
    538540         * @return array Associative array.
    539541         */
     
    626628         * @global wpdb $wpdb WordPress database object.
    627629         *
    628          * @param string $search_terms The terms to search the profile table
    629          *        value column for.
    630          * @param integer $limit The limit of results we want.
    631          * @param integer $page The page we are on for pagination.
     630         * @param string  $search_terms    The terms to search the profile table
     631         *                                 value column for.
     632         * @param int     $limit          The limit of results we want.
     633         * @param int     $page            The page we are on for pagination.
    632634         * @param boolean $populate_extras Populate extra user fields?
     635         *
    633636         * @return array Associative array.
    634637         */
     
    686689         * @global wpdb $wpdb WordPress database object.
    687690         *
    688          * @param array $paged_users An array of stdClass containing the users.
    689          * @param string $user_ids The user ids to select information about.
    690          * @param string $type The type of fields we wish to get.
     691         * @param array       $paged_users An array of stdClass containing the users.
     692         * @param string      $user_ids    The user ids to select information about.
     693         * @param string|bool $type        The type of fields we wish to get.
     694         *
    691695         * @return mixed False on error, otherwise associative array of results.
    692696         */
     
    773777         * @global wpdb $wpdb WordPress database object.
    774778         *
    775          * @param integer $user_id User ID.
     779         * @param int $user_id User ID.
     780         *
    776781         * @return array Associative array.
    777782         */
     
    789794         *
    790795         * @param int|array User IDs or multiple user IDs.
     796         *
    791797         * @return array
    792798         */
     
    836842         * @since BuddyPress (2.0.0)
    837843         *
    838          * @param int $user_id ID of the user whose last_activity you are updating.
    839          * @param string $time MySQL-formatted time string.
     844         * @param int    $user_id ID of the user whose last_activity you are updating.
     845         * @param string $time    MySQL-formatted time string.
     846         *
    840847         * @return bool True on success, false on failure.
    841848         */
     
    926933         *
    927934         * @param int $user_id
     935         *
    928936         * @return bool True on success, false on failure or if no last_activity
    929          *         is found for the user.
     937         *              is found for the user.
    930938         */
    931939        public static function delete_last_activity( $user_id ) {
  • trunk/src/bp-core/classes/class-bp-date-query.php

    r9819 r10012  
    3434         * Constructor.
    3535         *
     36         * @param array  $date_query
     37         * @param string $column
     38         *
    3639         * @see WP_Date_Query::__construct()
    3740         */
     
    5558         * Registers our date column with WP Date Query to pass validation.
    5659         *
    57          * @param array $retval Current DB columns
     60         * @param array $retval Current DB columns.
     61         *
    5862         * @return array
    5963         */
  • trunk/src/bp-core/classes/class-bp-embed.php

    r9819 r10012  
    8181         * @uses WP_Embed::maybe_make_link()
    8282         *
    83          * @param array $attr Shortcode attributes.
    84          * @param string $url The URL attempting to be embeded.
     83         * @param array  $attr Shortcode attributes.
     84         * @param string $url  The URL attempting to be embeded.
     85         *
    8586         * @return string The embed HTML on success, otherwise the original URL.
    8687         */
     
    170171         *       oEmbed failure.
    171172         *
    172          * @param int $id ID to do the caching for.
    173          * @param string $url The URL attempting to be embedded.
    174          * @param array $attr Shortcode attributes from {@link WP_Embed::shortcode()}.
    175          * @param array $rawattr Untouched shortcode attributes from
    176          *        {@link WP_Embed::shortcode()}.
     173         * @param int    $id      ID to do the caching for.
     174         * @param string $url     The URL attempting to be embedded.
     175         * @param array  $attr    Shortcode attributes from {@link WP_Embed::shortcode()}.
     176         * @param array  $rawattr Untouched shortcode attributes from
     177         *                        {@link WP_Embed::shortcode()}.
     178         *
    177179         * @return string The embed HTML on success, otherwise the original URL.
    178180         */
  • trunk/src/bp-core/classes/class-bp-media-extractor.php

    r9819 r10012  
    1313 * Extracts media from text. Use {@link extract()}.
    1414 *
     15 * @since BuddyPress (2.3.0)
     16 *
    1517 * The supported types are links, mentions, images, shortcodes, embeds, audio, video, and "all".
    1618 * This is what each type extracts:
     
    1820 * Links:      <a href="http://example.com">
    1921 * Mentions:   @name
    20  *             If the Activity component is enabled, we use it to parse out any @names. A consequence
     22 *             If the Activity component is enabled, we use it to parse out any at-names. A consequence
    2123 *             to note is that the "name" mentioned must match a real user account. If it's a made-up
    22  *             @name, then it isn't extracted.
    23  *             If the Activity component is disabled, any @name is extracted (both those matching
     24 *             at-name, then it isn't extracted.
     25 *             If the Activity component is disabled, any at-name is extracted (both those matching
    2426 *             real accounts, and those made-up).
    2527 * Images:     <img src="image.gif">, [gallery], [gallery ids="2,3"], featured images (Post thumbnails).
     
    3537 *
    3638 * @see BP_Media_Extractor::extract() Use this to extract media.
    37  * @since BuddyPress (2.3.0)
    3839 */
    3940class BP_Media_Extractor {
     
    5758         * Extract media from text.
    5859         *
    59          * @param string|WP_Post $richtext Content to parse.
    60          * @param int $what_to_extract Media type to extract (optional).
    61          * @param array $extra_args Bespoke data for a particular extractor (optional).
     60         * @since BuddyPress (2.3.0)
     61         *
     62         * @param string|WP_Post $richtext        Content to parse.
     63         * @param int            $what_to_extract Media type to extract (optional).
     64         * @param array          $extra_args      Bespoke data for a particular extractor (optional).
     65         *
    6266         * @return array {
    6367         *     @type array $has Extracted media counts. {
     
    7478         *
    7579         *         @type string $source Media source. Either "html" or "shortcodes".
    76          *         @type string $url Link to audio.
     80         *         @type string $url    Link to audio.
    7781         *     }
    7882         *     @type array $embeds Extracted oEmbeds. {
     
    8488         *         Array of extracted media.
    8589         *
    86          *         @type int $gallery_id Gallery ID. Optional, not always set.
    87          *         @type int $height Width of image. If unknown, set to 0.
    88          *         @type string $source Media source. Either "html" or "galleries".
    89          *         @type string $url Link to image.
    90          *         @type int $width Width of image. If unknown, set to 0.
     90         *         @type int    $gallery_id Gallery ID. Optional, not always set.
     91         *         @type int    $height    Width of image. If unknown, set to 0.
     92         *         @type string $source     Media source. Either "html" or "galleries".
     93         *         @type string $url        Link to image.
     94         *         @type int    $width      Width of image. If unknown, set to 0.
    9195         *     }
    9296         *     @type array $links Extracted URLs. {
     
    98102         *         Array of extracted media.
    99103         *
    100          *         @type string $name @mention.
     104         *         @type string $name    @mention.
    101105         *         @type string $user_id User ID. Optional, only set if Activity component enabled.
    102106         *     }
     
    104108         *         Array of extracted media.
    105109         *
    106          *         @type array $attributes Key/value pairs of the shortcodes attributes (if any).
    107          *         @type string $content Text wrapped by the shortcode.
    108          *         @type string $type Shortcode type.
    109          *         @type string $original The entire shortcode.
     110         *         @type array  $attributes Key/value pairs of the shortcodes attributes (if any).
     111         *         @type string $content    Text wrapped by the shortcode.
     112         *         @type string $type       Shortcode type.
     113         *         @type string $original   The entire shortcode.
    110114         *     }
    111115         *     @type array $videos Extracted video. {
     
    113117         *
    114118         *         @type string $source Media source. Currently only "shortcodes".
    115          *         @type string $url Link to audio.
     119         *         @type string $url    Link to audio.
    116120         *     }
    117121         * }
    118          * @since BuddyPress (2.3.0)
    119122         */
    120123        public function extract( $richtext, $what_to_extract = self::ALL, $extra_args = array() ) {
     
    168171                 * Filters media extracted from text.
    169172                 *
    170                  * @param array $media Extracted media. See {@link BP_Media_Extractor::extract()} for format.
    171                  * @param string $richtext Content to parse.
    172                  * @param int $what_to_extract Media type to extract.
    173                  * @param array $extra_args Bespoke data for a particular extractor.
    174                  * @param string $plaintext Copy of $richtext without any markup.
    175                  * @since BuddyPress (2.3.0)
     173                 * @since BuddyPress (2.3.0)
     174                 *
     175                 * @param array  $media           Extracted media. See {@link BP_Media_Extractor::extract()} for format.
     176                 * @param string $richtext        Content to parse.
     177                 * @param int    $what_to_extract Media type to extract.
     178                 * @param array  $extra_args      Bespoke data for a particular extractor.
     179                 * @param string $plaintext       Copy of $richtext without any markup.
    176180                 */
    177181                return apply_filters( 'bp_media_extractor_extract', $media, $richtext, $what_to_extract, $extra_args, $plaintext );
     
    188192         * Extract `<a href>` tags from text.
    189193         *
    190          * @param string $richtext Content to parse.
    191          * @param string $plaintext Sanitized version of the content.
    192          * @param array $extra_args Bespoke data for a particular extractor (optional).
     194         * @since BuddyPress (2.3.0)
     195         *
     196         * @param string $richtext   Content to parse.
     197         * @param string $plaintext  Sanitized version of the content.
     198         * @param array  $extra_args Bespoke data for a particular extractor (optional).
     199         *
    193200         * @return array {
    194201         *     @type array $has Extracted media counts. {
     
    201208         *     }
    202209         * }
    203          * @since BuddyPress (2.3.0)
    204210         */
    205211        protected function extract_links( $richtext, $plaintext, $extra_args = array() ) {
     
    228234                 * Filters links extracted from text.
    229235                 *
    230                  * @param array $data Extracted links. See {@link BP_Media_Extractor::extract_links()} for format.
    231                  * @param string $richtext Content to parse.
    232                  * @param string $plaintext Copy of $richtext without any markup.
    233                  * @param array $extra_args Bespoke data for a particular extractor.
    234                  * @since BuddyPress (2.3.0)
     236                 * @since BuddyPress (2.3.0)
     237                 *
     238                 * @param array  $data       Extracted links. See {@link BP_Media_Extractor::extract_links()} for format.
     239                 * @param string $richtext   Content to parse.
     240                 * @param string $plaintext  Copy of $richtext without any markup.
     241                 * @param array  $extra_args Bespoke data for a particular extractor.
    235242                 */
    236243                return apply_filters( 'bp_media_extractor_links', $data, $richtext, $plaintext, $extra_args );
     
    245252         * If the Activity component is disabled, any @mentions are extracted.
    246253         *
    247          * @param string $richtext Content to parse.
    248          * @param string $plaintext Sanitized version of the content.
    249          * @param array $extra_args Bespoke data for a particular extractor.
     254         * @since BuddyPress (2.3.0)
     255         *
     256         * @param string $richtext   Content to parse.
     257         * @param string $plaintext  Sanitized version of the content.
     258         * @param array  $extra_args Bespoke data for a particular extractor.
     259         *
    250260         * @return array {
    251261         *     @type array $has Extracted media counts. {
     
    255265         *         Array of extracted media.
    256266         *
    257          *         @type string $name @mention.
     267         *         @type string $name    @mention.
    258268         *         @type string $user_id User ID. Optional, only set if Activity component enabled.
    259269         *     }
    260270         * }
    261          * @since BuddyPress (2.3.0)
    262271         */
    263272        protected function extract_mentions( $richtext, $plaintext, $extra_args = array() ) {
     
    300309                 * Filters @mentions extracted from text.
    301310                 *
    302                  * @param array $data Extracted @mentions. See {@link BP_Media_Extractor::extract_mentions()} for format.
    303                  * @param string $richtext Content to parse.
    304                  * @param string $plaintext Copy of $richtext without any markup.
    305                  * @param array $extra_args Bespoke data for a particular extractor (optional).
    306                  * @since BuddyPress (2.3.0)
     311                 * @since BuddyPress (2.3.0)
     312                 *
     313                 * @param array  $data       Extracted @mentions. See {@link BP_Media_Extractor::extract_mentions()} for format.
     314                 * @param string $richtext   Content to parse.
     315                 * @param string $plaintext  Copy of $richtext without any markup.
     316                 * @param array  $extra_args Bespoke data for a particular extractor (optional).
    307317                 */
    308318                return apply_filters( 'bp_media_extractor_mentions', $data, $richtext, $plaintext, $extra_args );
     
    314324         * If an image is in the Media Library, then its resolution is included in the results.
    315325         *
    316          * @param string $richtext Content to parse.
    317          * @param string $plaintext Sanitized version of the content.
    318          * @param array $extra_args Bespoke data for a particular extractor (optional).
     326         * @since BuddyPress (2.3.0)
     327         *
     328         * @param string $richtext   Content to parse.
     329         * @param string $plaintext  Sanitized version of the content.
     330         * @param array  $extra_args Bespoke data for a particular extractor (optional).
     331         *
    319332         * @return array {
    320333         *     @type array $has Extracted media counts. {
     
    324337         *         Array of extracted media.
    325338         *
    326          *         @type int $gallery_id Gallery ID. Optional, not always set.
    327          *         @type int $height Width of image. If unknown, set to 0.
    328          *         @type string $source Media source. Either "html" or "galleries".
    329          *         @type string $url Link to image.
    330          *         @type int $width Width of image. If unknown, set to 0.
     339         *         @type int    $gallery_id Gallery ID. Optional, not always set.
     340         *         @type int    $height    Width of image. If unknown, set to 0.
     341         *         @type string $source     Media source. Either "html" or "galleries".
     342         *         @type string $url        Link to image.
     343         *         @type int    $width      Width of image. If unknown, set to 0.
    331344         *     }
    332345         * }
    333          * @since BuddyPress (2.3.0)
    334346         */
    335347        protected function extract_images( $richtext, $plaintext, $extra_args = array() ) {
     
    416428                 * Filters images extracted from text.
    417429                 *
    418                  * @param array $media Extracted images. See {@link BP_Media_Extractor::extract_images()} for format.
    419                  * @param string $richtext Content to parse.
    420                  * @param string $plaintext Copy of $richtext without any markup.
    421                  * @param array $extra_args Bespoke data for a particular extractor.
    422                  * @since BuddyPress (2.3.0)
     430                 * @since BuddyPress (2.3.0)
     431                 *
     432                 * @param array  $media      Extracted images. See {@link BP_Media_Extractor::extract_images()} for format.
     433                 * @param string $richtext   Content to parse.
     434                 * @param string $plaintext  Copy of $richtext without any markup.
     435                 * @param array  $extra_args Bespoke data for a particular extractor.
    423436                 */
    424437                return apply_filters( 'bp_media_extractor_images', $media, $richtext, $plaintext, $extra_args );
     
    431444         * For example, [gallery] and [audio].
    432445         *
    433          * @param string $richtext Content to parse.
    434          * @param string $plaintext Sanitized version of the content.
    435          * @param array $extra_args Bespoke data for a particular extractor (optional).
     446         * @since BuddyPress (2.3.0)
     447         *
     448         * @param string $richtext   Content to parse.
     449         * @param string $plaintext  Sanitized version of the content.
     450         * @param array  $extra_args Bespoke data for a particular extractor (optional).
     451         *
    436452         * @return array {
    437453         *     @type array $has Extracted media counts. {
     
    441457         *         Array of extracted media.
    442458         *
    443          *         @type array $attributes Key/value pairs of the shortcodes attributes (if any).
    444          *         @type string $content Text wrapped by the shortcode.
    445          *         @type string $type Shortcode type.
    446          *         @type string $original The entire shortcode.
     459         *         @type array  $attributes Key/value pairs of the shortcodes attributes (if any).
     460         *         @type string $content    Text wrapped by the shortcode.
     461         *         @type string $type       Shortcode type.
     462         *         @type string $original   The entire shortcode.
    447463         *     }
    448464         * }
    449          * @since BuddyPress (2.3.0)
    450465         */
    451466        protected function extract_shortcodes( $richtext, $plaintext, $extra_args = array() ) {
     
    477492                 * Filters shortcodes extracted from text.
    478493                 *
    479                  * @param array $data Extracted shortcodes. See {@link BP_Media_Extractor::extract_shortcodes()} for format.
    480                  * @param string $richtext Content to parse.
    481                  * @param string $plaintext Copy of $richtext without any markup.
    482                  * @param array $extra_args Bespoke data for a particular extractor.
    483                  * @since BuddyPress (2.3.0)
     494                 * @since BuddyPress (2.3.0)
     495                 *
     496                 * @param array  $data       Extracted shortcodes.
     497                 *                           See {@link BP_Media_Extractor::extract_shortcodes()} for format.
     498                 * @param string $richtext   Content to parse.
     499                 * @param string $plaintext  Copy of $richtext without any markup.
     500                 * @param array  $extra_args Bespoke data for a particular extractor.
    484501                 */
    485502                return apply_filters( 'bp_media_extractor_shortcodes', $data, $richtext, $plaintext, $extra_args );
     
    489506         * Extract any URL, matching a registered oEmbed endpoint, from text.
    490507         *
    491          * @param string $richtext Content to parse.
    492          * @param string $plaintext Sanitized version of the content.
    493          * @param array $extra_args Bespoke data for a particular extractor (optional).
     508         * @since BuddyPress (2.3.0)
     509         *
     510         * @param string $richtext   Content to parse.
     511         * @param string $plaintext  Sanitized version of the content.
     512         * @param array  $extra_args Bespoke data for a particular extractor (optional).
     513         *
    494514         * @return array {
    495515         *     @type array $has Extracted media counts. {
     
    502522         *     }
    503523         * }
    504          * @since BuddyPress (2.3.0)
    505524         */
    506525        protected function extract_embeds( $richtext, $plaintext, $extra_args = array() ) {
     
    552571                 * Filters embeds extracted from text.
    553572                 *
    554                  * @param array $data Extracted embeds. See {@link BP_Media_Extractor::extract_embeds()} for format.
    555                  * @param string $richtext Content to parse.
    556                  * @param string $plaintext Copy of $richtext without any markup.
    557                  * @param array $extra_args Bespoke data for a particular extractor.
    558                  * @since BuddyPress (2.3.0)
     573                 * @since BuddyPress (2.3.0)
     574                 *
     575                 * @param array  $data       Extracted embeds. See {@link BP_Media_Extractor::extract_embeds()} for format.
     576                 * @param string $richtext   Content to parse.
     577                 * @param string $plaintext  Copy of $richtext without any markup.
     578                 * @param array  $extra_args Bespoke data for a particular extractor.
    559579                 */
    560580                return apply_filters( 'bp_media_extractor_embeds', $data, $richtext, $plaintext, $extra_args );
     
    564584         * Extract [audio] shortcodes and `<a href="*.mp3">` tags, from text.
    565585         *
    566          * @param string $richtext Content to parse.
    567          * @param string $plaintext Sanitized version of the content.
    568          * @param array $extra_args Bespoke data for a particular extractor (optional).
     586         * @since BuddyPress (2.3.0)
     587         *
     588         * @see wp_get_audio_extensions() for supported audio formats.
     589         *
     590         * @param string $richtext   Content to parse.
     591         * @param string $plaintext  Sanitized version of the content.
     592         * @param array  $extra_args Bespoke data for a particular extractor (optional).
     593         *
    569594         * @return array {
    570595         *     @type array $has Extracted media counts. {
     
    575600         *
    576601         *         @type string $original The entire shortcode.
    577          *         @type string $source Media source. Either "html" or "shortcodes".
    578          *         @type string $url Link to audio.
     602         *         @type string $source   Media source. Either "html" or "shortcodes".
     603         *         @type string $url      Link to audio.
    579604         *     }
    580605         * }
    581          * @see wp_get_audio_extensions() for supported audio formats.
    582          * @since BuddyPress (2.3.0)
    583606         */
    584607        protected function extract_audio( $richtext, $plaintext, $extra_args = array() ) {
     
    646669                 * Filters audio extracted from text.
    647670                 *
    648                  * @param array $data Extracted audio. See {@link BP_Media_Extractor::extract_audio()} for format.
    649                  * @param string $richtext Content to parse.
    650                  * @param string $plaintext Copy of $richtext without any markup.
    651                  * @param array $extra_args Bespoke data for a particular extractor.
    652                  * @since BuddyPress (2.3.0)
     671                 * @since BuddyPress (2.3.0)
     672                 *
     673                 * @param array  $data       Extracted audio. See {@link BP_Media_Extractor::extract_audio()} for format.
     674                 * @param string $richtext   Content to parse.
     675                 * @param string $plaintext  Copy of $richtext without any markup.
     676                 * @param array  $extra_args Bespoke data for a particular extractor.
    653677                 */
    654678                return apply_filters( 'bp_media_extractor_audio', $data, $richtext, $plaintext, $extra_args );
     
    658682         * Extract [video] shortcodes from text.
    659683         *
    660          * @param string $richtext Content to parse.
    661          * @param string $plaintext Sanitized version of the content.
    662          * @param array $extra_args Bespoke data for a particular extractor (optional).
     684         * @since BuddyPress (2.3.0)
     685         *
     686         * @see wp_get_video_extensions() for supported video formats.
     687         *
     688         * @param string $richtext   Content to parse.
     689         * @param string $plaintext  Sanitized version of the content.
     690         * @param array  $extra_args Bespoke data for a particular extractor (optional).
     691         *
    663692         * @return array {
    664693         *     @type array $has Extracted media counts. {
     
    669698         *
    670699         *         @type string $source Media source. Currently only "shortcodes".
    671          *         @type string $url Link to audio.
     700         *         @type string $url    Link to audio.
    672701         *     }
    673702         * }
    674          * @see wp_get_video_extensions() for supported video formats.
    675          * @since BuddyPress (2.3.0)
    676703         */
    677704        protected function extract_video( $richtext, $plaintext, $extra_args = array() ) {
     
    718745                 * Filters videos extracted from text.
    719746                 *
    720                  * @param array $data Extracted videos. See {@link BP_Media_Extractor::extract_videos()} for format.
    721                  * @param string $richtext Content to parse.
    722                  * @param string $plaintext Copy of $richtext without any markup.
    723                  * @param array $extra_args Bespoke data for a particular extractor.
    724                  * @since BuddyPress (2.3.0)
     747                 * @since BuddyPress (2.3.0)
     748                 *
     749                 * @param array  $data       Extracted videos. See {@link BP_Media_Extractor::extract_videos()} for format.
     750                 * @param string $richtext   Content to parse.
     751                 * @param string $plaintext  Copy of $richtext without any markup.
     752                 * @param array  $extra_args Bespoke data for a particular extractor.
    725753                 */
    726754                return apply_filters( 'bp_media_extractor_videos', $data, $richtext, $plaintext, $extra_args );
     
    735763         * Extract images in [galleries] shortcodes from text.
    736764         *
    737          * @param string $richtext Content to parse.
    738          * @param string $plaintext Sanitized version of the content.
    739          * @param array $extra_args Bespoke data for a particular extractor (optional).
     765         * @since BuddyPress (2.3.0)
     766         *
     767         * @param string $richtext   Content to parse.
     768         * @param string $plaintext  Sanitized version of the content.
     769         * @param array  $extra_args Bespoke data for a particular extractor (optional).
     770         *
    740771         * @return array
    741          * @since BuddyPress (2.3.0)
    742772         */
    743773        protected function extract_images_from_galleries( $richtext, $plaintext, $extra_args = array() ) {
     
    820850                 * Filters image galleries extracted from text.
    821851                 *
    822                  * @param array $galleries_data Galleries. See {@link BP_Media_Extractor::extract_images_from_galleries()}.
    823                  * @param string $richtext Content to parse.
    824                  * @param string $plaintext Copy of $richtext without any markup.
    825                  * @param array $extra_args Bespoke data for a particular extractor.
    826                  * @since BuddyPress (2.3.0)
     852                 * @since BuddyPress (2.3.0)
     853                 *
     854                 * @param array  $galleries_data Galleries. See {@link BP_Media_Extractor::extract_images_from_galleries()}.
     855                 * @param string $richtext       Content to parse.
     856                 * @param string $plaintext      Copy of $richtext without any markup.
     857                 * @param array  $extra_args     Bespoke data for a particular extractor.
    827858                 */
    828859                return apply_filters( 'bp_media_extractor_galleries', $galleries_data, $richtext, $plaintext, $extra_args );
     
    832863         * Extract the featured image from a Post.
    833864         *
    834          * @param string $richtext Content to parse.
    835          * @param string $plaintext Sanitized version of the content.
    836          * @param array $extra_args Contains data that an implementation might need beyond the defaults.
     865         * @since BuddyPress (2.3.0)
     866         *
     867         * @param string $richtext   Content to parse.
     868         * @param string $plaintext  Sanitized version of the content.
     869         * @param array  $extra_args Contains data that an implementation might need beyond the defaults.
     870         *
    837871         * @return array
    838          * @since BuddyPress (2.3.0)
    839872         */
    840873        protected function extract_images_from_featured_images( $richtext, $plaintext, $extra_args ) {
     
    869902                 * Filters featured images extracted from a WordPress Post.
    870903                 *
    871                  * @param array $image Extracted images. See {@link BP_Media_Extractor_Post::extract_images()} for format.
    872                  * @param string $richtext Content to parse.
    873                  * @param string $plaintext Copy of $richtext without any markup.
    874                  * @param array $extra_args Bespoke data for a particular extractor.
    875                  * @since BuddyPress (2.3.0)
     904                 * @since BuddyPress (2.3.0)
     905                 *
     906                 * @param array  $image      Extracted images. See {@link BP_Media_Extractor_Post::extract_images()} for format.
     907                 * @param string $richtext   Content to parse.
     908                 * @param string $plaintext  Copy of $richtext without any markup.
     909                 * @param array  $extra_args Bespoke data for a particular extractor.
    876910                 */
    877911                return apply_filters( 'bp_media_extractor_featured_images', $image, $richtext, $plaintext, $extra_args );
     
    883917         * HTML tags and shortcodes are removed, and HTML entities are decoded.
    884918         *
     919         * @since BuddyPress (2.3.0)
     920         *
    885921         * @param string $richtext
     922         *
    886923         * @return string
    887          * @since BuddyPress (2.3.0)
    888924         */
    889925        protected function strip_markup( $richtext ) {
     
    893929                 * Filters the generated plain text version of the content passed to the extractor.
    894930                 *
    895                  * @param array $plaintext Generated plain text.
    896                  * @param string $richtext Original content
    897                  * @since BuddyPress (2.3.0)
     931                 * @since BuddyPress (2.3.0)
     932                 *
     933                 * @param array  $plaintext Generated plain text.
     934                 * @param string $richtext  Original content.
    898935                 */
    899936                return apply_filters( 'bp_media_extractor_strip_markup', $plaintext, $richtext );
  • trunk/src/bp-core/classes/class-bp-members-suggestions.php

    r9819 r10012  
    2525         * @since BuddyPress (2.1.0)
    2626         * @var array $args {
    27          *     @type int $limit Maximum number of results to display. Default: 16.
    28          *     @type bool $only_friends If true, only match the current user's friends. Default: false.
    29          *     @type string $term The suggestion service will try to find results that contain this string.
    30          *           Mandatory.
     27         *     @type int    $limit        Maximum number of results to display. Default: 16.
     28         *     @type bool   $only_friends If true, only match the current user's friends. Default: false.
     29         *     @type string $term         The suggestion service will try to find results that contain this string.
     30         *                                Mandatory.
    3131         * }
    3232         */
     
    4242         * Validate and sanitise the parameters for the suggestion service query.
    4343         *
     44         * @since BuddyPress (2.1.0)
     45         *
    4446         * @return true|WP_Error If validation fails, return a WP_Error object. On success, return true (bool).
    45          * @since BuddyPress (2.1.0)
    4647         */
    4748        public function validate() {
     
    7778         * Find and return a list of username suggestions that match the query.
    7879         *
     80         * @since BuddyPress (2.1.0)
     81         *
    7982         * @return array|WP_Error Array of results. If there were problems, returns a WP_Error object.
    80          * @since BuddyPress (2.1.0)
    8183         */
    8284        public function get_suggestions() {
  • trunk/src/bp-core/classes/class-bp-recursive-query.php

    r9819 r10012  
    3838         * @access protected
    3939         *
    40          * @param  string $primary_table
    41          * @param  string $primary_id_column
    4240         * @return array
    4341         */
     
    144142         * @access public
    145143         *
    146          * @param  array $queries Array of query clauses.
     144         * @param array $queries Array of query clauses.
     145         *
    147146         * @return array Sanitized array of query clauses.
    148147         */
     
    211210         * @access protected
    212211         *
    213          * @param  array $clause       Array of arguments belonging to the clause.
    214          * @param  array $parent_query Parent query to which the clause belongs.
     212         * @param array $clause       Array of arguments belonging to the clause.
     213         * @param array $parent_query Parent query to which the clause belongs.
     214         *
    215215         * @return array {
    216216         *     @type array $join  Array of subclauses for the JOIN statement.
     
    228228         * @access protected
    229229         *
    230          * @param  array $q Clause to check.
     230         * @param array $query Clause to check.
     231         *
    231232         * @return bool
    232233         */
  • trunk/src/bp-core/classes/class-bp-suggestions.php

    r9819 r10012  
    7070         *
    7171         * @param array $args {
    72          *     @type int $limit Maximum number of results to display. Optional, default: 16.
    73          *     @type string $type The name of the suggestion service to use for the request. Mandatory.
    74          *     @type string $term The suggestion service will try to find results that contain this string.
    75          *           Mandatory.
     72         *     @type int    $limit Maximum number of results to display. Optional, default: 16.
     73         *     @type string $type  The name of the suggestion service to use for the request. Mandatory.
     74         *     @type string $term  The suggestion service will try to find results that contain this string.
     75         *                         Mandatory.
    7676         * }
    7777         * @since BuddyPress (2.1.0)
     
    8787         * If validation fails, you must return a WP_Error object.
    8888         *
     89         * @since BuddyPress (2.1.0)
     90         *
    8991         * @return true|WP_Error If validation fails, return a WP_Error object. On success, return true (bool).
    90          * @since BuddyPress (2.1.0)
    9192         */
    9293        public function validate() {
     
    134135         * For example: { 'ID': 'admin', 'image': 'http://example.com/logo.png', 'name': 'Name Surname' }
    135136         *
     137         * @since BuddyPress (2.1.0)
     138         *
    136139         * @return array|WP_Error Array of results. If there were problems, returns a WP_Error object.
    137          * @since BuddyPress (2.1.0)
    138140         */
    139141        abstract public function get_suggestions();
  • trunk/src/bp-core/classes/class-bp-user-query.php

    r9977 r10012  
    4242 *     @type array|string      $member_type__in     Array or comma-separated list of member types to limit results to.
    4343 *     @type array|string      $member_type__not_in Array or comma-separated list of member types that will be
    44  *                                                  excluded from results.
     44 *                                                                   excluded from results.
    4545 *     @type string|bool       $meta_key            Limit results to users that have usermeta associated with this meta_key.
    4646 *                                                  Usually used with $meta_value. Default: false.
     
    619619         * @since BuddyPress (1.8.0)
    620620         *
    621          * @param array Sanitized array of user IDs, as passed to the 'include'
    622          *        parameter of the class constructor.
     621         * @param array $include Sanitized array of user IDs, as passed to the 'include'
     622         *                       parameter of the class constructor.
     623         *
    623624         * @return array The list of users to which the main query should be
    624          *         limited.
     625         *               limited.
    625626         */
    626627        public function get_include_ids( $include = array() ) {
     
    759760         * @param string|array $member_types Array or comma-separated list of member types.
    760761         * @param string       $operator     'IN' or 'NOT IN'.
     762         *
     763         * @return string
    761764         */
    762765        protected function get_sql_clause_for_member_types( $member_types, $operator ) {
  • trunk/src/bp-core/classes/class-bp-walker-nav-menu-checklist.php

    r9819 r10012  
    1414 *
    1515 * Borrowed heavily from {@link Walker_Nav_Menu_Checklist}, but modified so as not
    16  * to require an actual post type or taxonomy, and to force certain CSS classes
     16 * to require an actual post type or taxonomy, and to force certain CSS classes.
    1717 *
    1818 * @since BuddyPress (1.9.0)
     
    2525         * @see Walker_Nav_Menu::__construct() for a description of parameters.
    2626         *
    27          * @param array $fields See {@link Walker_Nav_Menu::__construct()}.
     27         * @param array|bool $fields See {@link Walker_Nav_Menu::__construct()}.
    2828         */
    2929        public function __construct( $fields = false ) {
     
    3939         *
    4040         * @param string $output See {@Walker_Nav_Menu::start_lvl()}.
    41          * @param int $depth See {@Walker_Nav_Menu::start_lvl()}.
    42          * @param array $args See {@Walker_Nav_Menu::start_lvl()}.
     41         * @param int    $depth See {@Walker_Nav_Menu::start_lvl()}.
     42         * @param array  $args  See {@Walker_Nav_Menu::start_lvl()}.
    4343         */
    4444        public function start_lvl( &$output, $depth = 0, $args = array() ) {
     
    5353         *
    5454         * @param string $output See {@Walker_Nav_Menu::end_lvl()}.
    55          * @param int $depth See {@Walker_Nav_Menu::end_lvl()}.
    56          * @param array $args See {@Walker_Nav_Menu::end_lvl()}.
     55         * @param int    $depth See {@Walker_Nav_Menu::end_lvl()}.
     56         * @param array  $args  See {@Walker_Nav_Menu::end_lvl()}.
    5757         */
    5858        public function end_lvl( &$output, $depth = 0, $args = array() ) {
     
    6666         * @see Walker::start_el() for description of parameters.
    6767         *
    68          * @param string $output Passed by reference. Used to append additional
    69          *        content.
    70          * @param object $item Menu item data object.
    71          * @param int $depth Depth of menu item. Used for padding.
    72          * @param object $args See {@Walker::start_el()}.
    73          * @param int $id See {@Walker::start_el()}.
     68         * @param string       $output Passed by reference. Used to append additional
     69         *                             content.
     70         * @param object       $item  Menu item data object.
     71         * @param int          $depth Depth of menu item. Used for padding.
     72         * @param object|array $args  See {@Walker::start_el()}.
     73         * @param int          $id    See {@Walker::start_el()}.
    7474         */
    7575        function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
  • trunk/src/bp-core/classes/class-bp-walker-nav-menu.php

    r9819 r10012  
    5050         * @see Walker::walk()
    5151         *
    52          * @param array $elements See {@link Walker::walk()}.
    53          * @param int $max_depth See {@link Walker::walk()}.
     52         * @param array $elements  See {@link Walker::walk()}.
     53         * @param int   $max_depth See {@link Walker::walk()}.
     54         *
    5455         * @return string See {@link Walker::walk()}.
    5556         */
     
    7980
    8081                /*
    81                  * need to display in hierarchical order
     82                 * Need to display in hierarchical order
    8283                 * separate elements into two buckets: top level and children elements
    8384                 * children_elements is two dimensional array, eg.
     
    9697
    9798                /*
    98                  * when none of the elements is top level
    99                  * assume the first one must be root of the sub elements
     99                 * When none of the elements is top level
     100                 * assume the first one must be root of the sub elements.
    100101                 */
    101102                if ( empty( $top_level_elements ) ) {
     
    135136         * Display the current <li> that we are on.
    136137         *
    137          * @see Walker::start_el() for complete description of parameters .
     138         * @see Walker::start_el() for complete description of parameters.
    138139         *
    139140         * @since BuddyPress (1.7.0)
    140141         *
    141142         * @param string $output Passed by reference. Used to append
    142          *        additional content.
    143          * @param object $item Menu item data object.
    144          * @param int $depth Depth of menu item. Used for padding. Optional,
    145          *        defaults to 0.
    146          * @param array $args Optional. See {@link Walker::start_el()}.
    147          * @param int $current_page Menu item ID. Optional.
     143         *                       additional content.
     144         * @param object $item   Menu item data object.
     145         * @param int    $depth Depth of menu item. Used for padding. Optional,
     146         *                       defaults to 0.
     147         * @param array  $args  Optional. See {@link Walker::start_el()}.
     148         * @param int    $id    Menu item ID. Optional.
    148149         */
    149150        public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
  • trunk/src/bp-core/deprecated/1.5.php

    r9819 r10012  
    3131 * @deprecated BuddyPress (1.5)
    3232 * @deprecated Use is_multisite()
     33 *
     34 * @return bool
    3335 */
    3436function bp_core_is_multisite() {
     
    4547 * @deprecated Use is_main_site()
    4648 * @package BuddyPress
    47  * @param int $blog_id optional blog id to test (default current blog)
     49 * @param int|string $blog_id optional blog id to test (default current blog)
    4850 * @return bool True if not multisite or $blog_id is main site
    4951 * @since BuddyPress (1.2.6)
     
    5456}
    5557
    56 /**
    57  * WPMU version of is_super_admin()
    58  *
    59  * @deprecated BuddyPress (1.5)
    60  * @deprecated Use is_super_admin()
    61  * @param int $user_id Optional. Defaults to logged-in user
    62  * @return bool True if is super admin
    63  */
    6458if ( !function_exists( 'is_site_admin' ) ) {
     59        /**
     60         * WPMU version of is_super_admin()
     61         *
     62         * @deprecated BuddyPress (1.5)
     63         * @deprecated Use is_super_admin()
     64         * @param int|bool $user_id Optional. Defaults to logged-in user
     65         * @return bool True if is super admin
     66         */
    6567        function is_site_admin( $user_id = false ) {
    6668                _deprecated_function( __FUNCTION__, '1.5', 'is_super_admin()' );
     
    7880 * @deprecated Use add_menu_page().
    7981 * @since BuddyPress (1.1)
     82 *
     83 * @return string
    8084 */
    8185function bp_core_add_admin_menu_page( $args = '' ) {
     
    284288         * @deprecated Use wp_title()
    285289         * @since BuddyPress (1.0)
     290         *
     291         * @return string
    286292         */
    287293        function bp_get_page_title() {
     
    379385 * BP 1.5 simplified notification functions a bit
    380386 * @deprecated BuddyPress (1.5)
     387 *
     388 * @return mixed
    381389 */
    382390function bp_core_delete_notifications_for_user_by_type( $user_id, $component_name, $component_action ) {
     
    385393}
    386394
     395/**
     396 * @return mixed
     397 */
    387398function bp_core_delete_notifications_for_user_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false ) {
    388399        _deprecated_function( __FUNCTION__, '1.5', 'bp_core_delete_notifications_by_item_id()' );
     
    500511         * @param string $oldvalue Previous value of get_option( 'page_on_front' )
    501512         * @param string $oldvalue New value of get_option( 'page_on_front' )
    502          * @return string
     513         * @return bool|string
    503514         * @since BuddyPress (1.2)
    504515         */
Note: See TracChangeset for help on using the changeset viewer.