Changeset 10012
- Timestamp:
- 07/12/2015 12:49:36 AM (9 years ago)
- Location:
- trunk/src/bp-core
- Files:
-
- 45 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/admin/bp-core-admin-actions.php
r9819 r10012 65 65 * @since BuddyPress (1.7.0) 66 66 * 67 * @param int $blog_id68 * @param int $user_id67 * @param int $blog_id 68 * @param int $user_id 69 69 * @param string $domain 70 70 * @param string $path 71 * @param int $site_id72 * @param array $meta71 * @param int $site_id 72 * @param array $meta 73 73 */ 74 74 function bp_new_site( $blog_id, $user_id, $domain, $path, $site_id, $meta ) { -
trunk/src/bp-core/admin/bp-core-admin-components.php
r9819 r10012 2 2 3 3 /** 4 * BuddyPress Admin Component Functions 4 * BuddyPress Admin Component Functions. 5 5 * 6 6 * @package BuddyPress … … 236 236 237 237 /** 238 * Handle saving the Component settings 238 * Handle saving the Component settings. 239 239 * 240 240 * @since BuddyPress (1.6.0) … … 278 278 279 279 /** 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. 281 281 * 282 282 * The way that active components must be set after saving your settings must … … 299 299 * @since BuddyPress (1.7.0) 300 300 * 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 * 303 304 * @return array The calculated list of component settings 304 305 */ … … 337 338 338 339 /** 339 * Return a list of component information, optionally filtered by type 340 * Return a list of component information, optionally filtered by type. 340 341 * 341 342 * We use this information both to build the markup for the admin screens, as … … 344 345 * @since BuddyPress (1.7.0) 345 346 * 346 * @param string $type 'all', 'optional', 'retired', 'required' 347 * @param string $type 'all', 'optional', 'retired', 'required'. 348 * 347 349 * @return array An array of requested component data 348 350 */ -
trunk/src/bp-core/admin/bp-core-admin-functions.php
r9873 r10012 2 2 3 3 /** 4 * BuddyPress Common Admin Functions 4 * BuddyPress Common Admin Functions. 5 5 * 6 6 * @package BuddyPress … … 115 115 116 116 /** 117 * Print admin messages to admin_notices or network_admin_notices 117 * Print admin messages to admin_notices or network_admin_notices. 118 118 * 119 119 * BuddyPress combines all its messages into a single notice, to avoid a preponderance of yellow … … 122 122 * @since BuddyPress (1.5.0) 123 123 * 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. 125 125 * @uses bp_is_root_blog() 126 126 */ … … 159 159 160 160 /** 161 * Add an admin notice to the BP queue 161 * Add an admin notice to the BP queue. 162 162 * 163 163 * Messages added with this function are displayed in BuddyPress's general purpose admin notices … … 168 168 * 169 169 * @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". 171 171 */ 172 172 function bp_core_add_admin_notice( $notice = '', $type = 'updated' ) { … … 190 190 191 191 /** 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. 193 193 * 194 194 * 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. 198 198 * The administrator will be shown a notice for each check that fails. 199 199 * … … 328 328 329 329 /** 330 * Redirect user to BuddyPress's What's New page on activation 330 * Redirect user to BuddyPress's What's New page on activation. 331 331 * 332 332 * @since BuddyPress (1.7.0) 333 333 * 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. 342 342 */ 343 343 function bp_do_activation_redirect() { … … 369 369 370 370 /** 371 * Output the tabs in the admin area 371 * Output the tabs in the admin area. 372 372 * 373 373 * @since BuddyPress (1.5.0) 374 * 374 375 * @param string $active_tab Name of the tab that is active. Optional. 375 376 */ … … 409 410 * 410 411 * @since BuddyPress (2.2.0) 412 * 411 413 * @param string $active_tab Name of the tab that is active. Optional. 414 * 415 * @return string 412 416 */ 413 417 function bp_core_get_admin_tabs( $active_tab = '' ) { … … 453 457 454 458 /** 455 * adds contextual help to BuddyPress admin pages 459 * adds contextual help to BuddyPress admin pages. 456 460 * 457 461 * @since BuddyPress (1.7.0) 458 462 * @todo Make this part of the BP_Component class and split into each component 463 * 464 * @param string $screen 459 465 */ 460 466 function bp_core_add_contextual_help( $screen = '' ) { … … 543 549 544 550 /** 545 * renders contextual help content to contextual help tabs 551 * renders contextual help content to contextual help tabs. 546 552 * 547 553 * @since BuddyPress (1.7.0) 554 * 555 * @param string $tab 556 * 557 * @return string 548 558 */ 549 559 function bp_core_add_contextual_help_content( $tab = '' ) { … … 582 592 583 593 /** 584 * Add a separator to the WordPress admin menus 594 * Add a separator to the WordPress admin menus. 585 595 * 586 596 * @since BuddyPress (1.7.0) 587 597 * 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. 589 599 */ 590 600 function bp_admin_separator() { … … 617 627 618 628 /** 619 * Tell WordPress we have a custom menu order 629 * Tell WordPress we have a custom menu order. 620 630 * 621 631 * @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 * 625 636 * @return bool Always true 626 637 */ … … 636 647 637 648 /** 638 * Move our custom separator above our custom post types 649 * Move our custom separator above our custom post types. 639 650 * 640 651 * @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 * 644 656 * @return array Modified menu order 645 657 */ … … 703 715 704 716 /** 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. 706 718 * 707 719 * WP_List_Tables have bulk actions at the top and at the bottom of the tables, … … 710 722 * 711 723 * @since BuddyPress (1.7.0) 724 * 712 725 * @return string 713 726 */ … … 727 740 728 741 /** 729 * Register meta box and associated JS for BuddyPress WP Nav Menu 742 * Register meta box and associated JS for BuddyPress WP Nav Menu. 730 743 * 731 744 * @since BuddyPress (1.9.0) … … 833 846 * @since BuddyPress (2.0.0) 834 847 * 835 * @param array $actionsUser row action links.848 * @param array $actions User row action links. 836 849 * @param object $user_object Current user information. 850 * 837 851 * @return array $actions User row action links. 838 852 */ -
trunk/src/bp-core/admin/bp-core-admin-schema.php
r9819 r10012 2 2 3 3 /** 4 * BuddyPress DB schema 4 * BuddyPress DB schema. 5 5 * 6 6 * @package BuddyPress … … 12 12 13 13 /** 14 * Get the DB schema to use for BuddyPress components 14 * Get the DB schema to use for BuddyPress components. 15 15 * 16 16 * @since BuddyPress (1.1.0) 17 17 * 18 18 * @global $wpdb $wpdb 19 * @return string The default database character-set, if set 19 * @return string The default database character-set, if set. 20 20 */ 21 21 function bp_core_set_charset() { … … 28 28 29 29 /** 30 * Main installer 30 * Main installer. 31 31 * 32 32 * Can be passed an optional array of components to explicitly run installation … … 35 35 * @since BuddyPress (1.0.0) 36 36 * 37 * @param array $active_components Components to install37 * @param array|bool $active_components Components to install. 38 38 */ 39 39 function bp_core_install( $active_components = false ) { … … 86 86 87 87 /** 88 * Install database tables for the Notifications component 88 * Install database tables for the Notifications component. 89 89 * 90 90 * @since BuddyPress (1.0.0) … … 130 130 131 131 /** 132 * Install database tables for the Activity component 132 * Install database tables for the Activity component. 133 133 * 134 134 * @since BuddyPress (1.0.0) … … 183 183 184 184 /** 185 * Install database tables for the Notifications component 185 * Install database tables for the Notifications component. 186 186 * 187 187 * @since BuddyPress (1.0.0) … … 211 211 212 212 /** 213 * Install database tables for the Groups component 213 * Install database tables for the Groups component. 214 214 * 215 215 * @since BuddyPress (1.0.0) … … 271 271 272 272 /** 273 * Install database tables for the Messages component 273 * Install database tables for the Messages component. 274 274 * 275 275 * @since BuddyPress (1.0.0) … … 331 331 332 332 /** 333 * Install database tables for the Profiles component 333 * Install database tables for the Profiles component. 334 334 * 335 335 * @since BuddyPress (1.0.0) … … 421 421 422 422 /** 423 * Install database tables for the Sites component 423 * Install database tables for the Sites component. 424 424 * 425 425 * @since BuddyPress (1.0.0) … … 501 501 * This is necessary because WordPress's `pre_schema_upgrade()` function wraps 502 502 * 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. 504 504 * 505 505 * @since BuddyPress (2.0.1) -
trunk/src/bp-core/admin/bp-core-admin-settings.php
r9828 r10012 2 2 3 3 /** 4 * BuddyPress Admin Settings 4 * BuddyPress Admin Settings. 5 5 * 6 6 * @package BuddyPress … … 12 12 13 13 /** 14 * Main settings section description for the settings page 14 * Main settings section description for the settings page. 15 15 * 16 16 * @since BuddyPress (1.6.0) … … 19 19 20 20 /** 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. 26 26 */ 27 27 function bp_admin_setting_callback_admin_bar() { … … 35 35 36 36 /** 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. 42 42 */ 43 43 function bp_admin_setting_callback_account_deletion() { … … 53 53 54 54 /** 55 * Groups settings section description for the settings page 55 * Groups settings section description for the settings page. 56 56 * 57 57 * @since BuddyPress (1.6.0) … … 60 60 61 61 /** 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. 67 67 */ 68 68 function bp_admin_setting_callback_activity_akismet() { … … 76 76 77 77 /** 78 * Allow activity comments on blog posts and forum posts 78 * Allow activity comments on blog posts and forum posts. 79 79 * 80 80 * @since BuddyPress (1.6.0) … … 104 104 105 105 /** 106 * Sanitization for bp-disable-blogforum-comments setting 106 * Sanitization for bp-disable-blogforum-comments setting. 107 107 * 108 108 * In the UI, a checkbox asks whether you'd like to *enable* blog/forum activity comments. For … … 111 111 * 112 112 * @since BuddyPress (1.6.0) 113 * 114 * @param bool $value 115 * 116 * @return bool 113 117 */ 114 118 function bp_admin_sanitize_callback_blogforum_comments( $value = false ) { … … 119 123 120 124 /** 121 * Profile settings section description for the settings page 125 * Profile settings section description for the settings page. 122 126 * 123 127 * @since BuddyPress (1.6.0) … … 126 130 127 131 /** 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. 133 137 */ 134 138 function bp_admin_setting_callback_profile_sync() { … … 142 146 143 147 /** 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. 149 153 */ 150 154 function bp_admin_setting_callback_avatar_uploads() { … … 160 164 161 165 /** 162 * Groups settings section description for the settings page 166 * Groups settings section description for the settings page. 163 167 * 164 168 * @since BuddyPress (1.6.0) … … 167 171 168 172 /** 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. 174 178 */ 175 179 function bp_admin_setting_callback_group_creation() { … … 198 202 199 203 /** 200 * Forums settings section description for the settings page 204 * Forums settings section description for the settings page. 201 205 * 202 206 * @since BuddyPress (1.6.0) … … 205 209 206 210 /** 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. 213 217 */ 214 218 function bp_admin_setting_callback_bbpress_configuration() { … … 238 242 * @since BuddyPress (1.6.0) 239 243 * 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. 243 247 */ 244 248 function bp_core_admin_settings() { … … 271 275 272 276 /** 273 * Save our settings 277 * Save our settings. 274 278 * 275 279 * @since BuddyPress (1.6.0) … … 318 322 319 323 /** 320 * Output settings API option 324 * Output settings API option. 321 325 * 322 326 * @since BuddyPress (1.6.0) … … 326 330 * @param string $option 327 331 * @param string $default 328 * @param bool $slug332 * @param bool $slug 329 333 */ 330 334 function bp_form_option( $option, $default = '' , $slug = false ) { … … 342 346 * @param string $option 343 347 * @param string $default 344 * @param bool $slug 348 * @param bool $slug 349 * 350 * @return string 345 351 */ 346 352 function bp_get_form_option( $option, $default = '', $slug = false ) { -
trunk/src/bp-core/admin/bp-core-admin-slugs.php
r9819 r10012 2 2 3 3 /** 4 * BuddyPress Admin Slug Functions 4 * BuddyPress Admin Slug Functions. 5 5 * 6 6 * @package BuddyPress … … 215 215 216 216 /** 217 * Handle saving of the BuddyPress slugs 217 * Handle saving of the BuddyPress slugs. 218 218 * 219 219 * @since BuddyPress (1.6.0) -
trunk/src/bp-core/admin/bp-core-admin-tools.php
r9819 r10012 2 2 3 3 /** 4 * BuddyPress Tools panel 4 * BuddyPress Tools panel. 5 5 * 6 6 * @since BuddyPress (2.0.0) … … 261 261 262 262 /** 263 * Recalculate user-to-blog relationships and useful blog meta data 263 * Recalculate user-to-blog relationships and useful blog meta data. 264 264 * 265 265 * @since BuddyPress (2.1.0) … … 322 322 * @since BuddyPress (2.0.0) 323 323 * 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 326 328 */ 327 329 function bp_admin_tools_feedback( $message, $class = false ) { -
trunk/src/bp-core/bp-core-actions.php
r9819 r10012 46 46 47 47 /** 48 * bp_loaded - Attached to 'plugins_loaded' above 48 * bp_loaded - Attached to 'plugins_loaded' above. 49 49 * 50 50 * Attach various loader actions to the bp_loaded action. … … 61 61 62 62 /** 63 * bp_init - Attached to 'init' above 63 * bp_init - Attached to 'init' above. 64 64 * 65 65 * Attach various initialization actions to the bp_init action. … … 79 79 80 80 /** 81 * bp_template_redirect - Attached to 'template_redirect' above 81 * bp_template_redirect - Attached to 'template_redirect' above. 82 82 * 83 83 * Attach various template actions to the bp_template_redirect action. … … 96 96 97 97 /** 98 * Add the BuddyPress functions file 98 * Add the BuddyPress functions file. 99 99 */ 100 100 add_action( 'bp_after_setup_theme', 'bp_load_theme_functions', 1 ); -
trunk/src/bp-core/bp-core-admin.php
r9909 r10012 421 421 * @since BuddyPress (1.6.0) 422 422 * 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 * 425 426 * @return array Processed links. 426 427 */ … … 775 776 776 777 /** 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. 778 779 * 779 780 * @since BuddyPress (2.2.0) … … 799 800 800 801 /** 801 * Output tab navigation for `What's New` and `Credits` pages 802 * Output tab navigation for `What's New` and `Credits` pages. 802 803 * 803 804 * @since BuddyPress (2.2.0) … … 821 822 822 823 /** 823 * Return true/false based on whether a query argument is set 824 * Return true/false based on whether a query argument is set. 824 825 * 825 826 * @see bp_do_activation_redirect() 826 827 * 827 828 * @since BuddyPress (2.2.0) 829 * 828 830 * @return bool 829 831 */ … … 833 835 834 836 /** 835 * Return a user-friendly version-number string, for use in translations 837 * Return a user-friendly version-number string, for use in translations. 836 838 * 837 839 * @since BuddyPress (2.2.0) 840 * 838 841 * @return string 839 842 */ -
trunk/src/bp-core/bp-core-adminbar.php
r9819 r10012 111 111 112 112 /** 113 * Enqueue supplemental WordPress Toolbar styling 113 * Enqueue supplemental WordPress Toolbar styling. 114 114 * 115 115 * @since BuddyPress (2.1.0) -
trunk/src/bp-core/bp-core-attachments.php
r9860 r10012 19 19 * @since BuddyPress (2.3.0) 20 20 * 21 * @return bool True if WordPress is 3.9+, false otherwise 21 * @return bool True if WordPress is 3.9+, false otherwise. 22 22 */ 23 23 function bp_attachments_is_wp_version_supported() { … … 26 26 27 27 /** 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. 33 33 */ 34 34 function bp_attachments_get_plupload_default_settings() { … … 84 84 85 85 /** 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. 91 91 */ 92 92 function bp_attachments_get_plupload_l10n() { … … 120 120 121 121 /** 122 * Enqueues the script needed for the Uploader UI 122 * Enqueues the script needed for the Uploader UI. 123 123 * 124 124 * @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 130 132 */ 131 133 function bp_attachments_enqueue_scripts( $class = '' ) { … … 240 242 241 243 /** 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. 243 245 * 244 246 * @since BuddyPress (2.3.0) … … 246 248 * @param array $avatar_nav An associative array of available nav items where each item is an array organized this way: 247 249 * $avatar_nav[ $nav_item_id ] { 248 * @type string $nav_item_id the nav item id in lower case without special characters or space249 * @type string $caption the name of the item nav that will be displayed in the nav250 * @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 hidden253 * (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). 254 256 * } 255 257 * @param string $object the object the avatar belongs to (eg: user or group) … … 298 300 * to avoid the scripts to be loaded more than once. 299 301 * 300 * @since BuddyPress 2.3.0302 * @since BuddyPress (2.3.0) 301 303 */ 302 304 do_action( 'bp_attachments_enqueue_scripts' ); … … 304 306 305 307 /** 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 312 316 */ 313 317 function bp_attachments_current_user_can( $capability, $args = array() ) { … … 351 355 * @since BuddyPress (2.3.0) 352 356 * 353 * @param bool true for a success, false otherwise354 * @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. 356 360 */ 357 361 function bp_attachments_json_response( $success, $is_html4 = false, $data = null ) { … … 381 385 * Get an Attachment template part. 382 386 * 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 386 392 */ 387 393 function bp_attachments_get_template_part( $slug ) { -
trunk/src/bp-core/bp-core-avatars.php
r9860 r10012 108 108 * add_filter( 'bp_core_fetch_avatar_no_grav', '__return_true' ); 109 109 * 110 * @param array $args {110 * @param array|string $args { 111 111 * An array of arguments. All arguments are technically optional; some 112 112 * will, if not provided, be auto-detected by bp_core_fetch_avatar(). This … … 114 114 * arguments. 115 115 * 116 * @type int|bool $item_id The numeric ID of the item for which you're117 * requestingan avatar (eg, a user ID). If no 'item_id' is present,118 * the function attempts to infer an ID from the 'object' + the119 * current context: if 'object' is 'user' and the current page is a120 * user page, 'item_id' will default to the displayed user ID; if121 * '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 in123 * this way, the function returns false. Default: false.124 * @type string $objectThe kind of object for which you're getting an125 * avatar. BuddyPress natively supports three options: 'user',126 * 'group', 'blog'; a plugin may register more. Default: 'user'.127 * @type string $typeWhen a new avatar is uploaded to BP, 'thumb' and128 * 'full' versions are saved. This parameter specifies whether you'd129 * 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'. 130 130 * @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 main135 * avatar directory (usually based on {@link wp_upload_dir()}); it's a136 * string like 'group-avatars' rather than the full directory path.137 * Generally, it'll only be necessary to override the default value if138 * storing avatars in a non-default location. Defaults to false139 * (auto-detected).140 * @type int|bool $widthRequested avatar width. The unit is px. This value141 * is used to build the 'width' attribute for the <img> element. If142 * no value is passed, BP uses the global avatar width for this143 * avatar type. Default: false (auto-detected).144 * @type int|bool $heightRequested avatar height. The unit is px. This145 * value is used to build the 'height' attribute for the <img>146 * element. If no value is passed, BP uses the global avatar height147 * for this avatar type. Default: false (auto-detected).148 * @type string $classThe CSS class for the <img> element. Note that BP149 * uses the 'avatar' class fairly extensively in its default styling,150 * so if you plan to pass a custom value, consider appending it to151 * '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 $titleThe title attribute for the <img> element.156 * Default: false.157 * @type string $altThe alt attribute for the <img> element. In BP, this158 * value is generally passed by the wrapper functions, where the data159 * necessary for concatenating the string is at hand; see160 * {@link bp_get_activity_avatar()} for an example. Default: ''.161 * @type string|bool $email An email to use in Gravatar queries. Unless162 * otherwise configured, BP uses Gravatar as a fallback for avatars163 * that are not provided locally. Gravatar's API requires using a hash164 * of the user's email address; this argument provides it. If not165 * provided, the function will infer it: for users, by getting the166 * user's email from the database, for groups/blogs, by concatenating167 * "{$item_id}-{$object}@{bp_get_root_domain()}". The user query adds168 * overhead, so it's recommended that wrapper functions provide a169 * value for 'email' when querying user IDs. Default: false.170 * @type bool $no_gravWhether to disable the default Gravatar fallback.171 * By default, BP will fall back on Gravatar when it cannot find a172 * local avatar. In some cases, this may be undesirable, in which173 * case 'no_grav' should be set to true. To disable Gravatar174 * fallbacks globally, see the 'bp_core_fetch_avatar_no_grav' filter.175 * Default: false.176 * @type bool $htmlWhether to return an <img> HTML element, vs a raw URL177 * 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. 179 179 * } 180 * 180 181 * @return string Formatted HTML <img> element, or raw avatar URL based on $html arg. 181 182 */ … … 530 531 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 ); 531 532 532 // ...or only the URL533 // ...or only the URL 533 534 } else { 534 535 … … 611 612 } 612 613 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. 614 615 } else { 615 616 … … 641 642 * Delete an existing avatar. 642 643 * 643 * @param array $args {644 * @param array|string $args { 644 645 * Array of function parameters. 645 646 * @type bool|int $item_id ID of the item whose avatar you're deleting. … … 721 722 722 723 /** 723 * Ajax delete an avatar for a given object and item id 724 * 725 * @since 726 * 727 * @return string ajson object containing success data if the avatar was deleted728 * error message otherwise724 * 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. 729 730 */ 730 731 function bp_avatar_ajax_delete() { … … 855 856 856 857 /** 857 * Ajax upload an avatar 858 * Ajax upload an avatar. 858 859 * 859 860 * @since BuddyPress (2.3.0) 860 861 * 861 * @return string ajson object containing success data if the upload succeeded862 * error message otherwise862 * @return string|null A json object containing success data if the upload succeeded 863 * error message otherwise. 863 864 */ 864 865 function bp_avatar_ajax_upload() { … … 923 924 } else { 924 925 /** 925 * Filter here to deal with other components 926 * Filter here to deal with other components. 926 927 * 927 928 * @since BuddyPress (2.3.0) 928 929 * 929 * @var array $bp_params the BuddyPress Ajax parameters 930 * @var array $bp_params the BuddyPress Ajax parameters. 930 931 */ 931 932 $bp_params = apply_filters( 'bp_core_avatar_ajax_upload_params', $bp_params ); … … 1008 1009 * @since BuddyPress (2.3.0) 1009 1010 * 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 * 1012 1014 * @return bool True on success, false on failure. 1013 1015 */ … … 1026 1028 } 1027 1029 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 */ 1028 1040 $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', $avatar_dir . '/' . $item_id, $item_id, 'user', 'avatars' ); 1029 1041 … … 1043 1055 $crop_args = array( 'item_id' => $item_id, 'original_file' => $avatar_to_crop, 'crop_x' => 0, 'crop_y' => 0 ); 1044 1056 1057 /** 1058 * Fires if the new avatar was successfully captured. 1059 * 1060 * @since BuddyPress (2.3.0) 1061 */ 1045 1062 do_action( 'xprofile_avatar_uploaded' ); 1046 1063 … … 1064 1081 * crop_y - The vertical starting point of the crop 1065 1082 * 1066 * @param array $args {1083 * @param array|string $args { 1067 1084 * 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. 1081 1099 * } 1100 * 1082 1101 * @return bool True on success, false on failure. 1083 1102 */ … … 1103 1122 * 1104 1123 * @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. 1106 1125 */ 1107 1126 if ( ! apply_filters( 'bp_core_pre_avatar_handle_crop', true, $r ) ) { … … 1122 1141 1123 1142 /** 1124 * Ajax set an avatar for a given object and item id 1143 * Ajax set an avatar for a given object and item id. 1125 1144 * 1126 1145 * @since BuddyPress (2.3.0) 1127 1146 * 1128 * @return string ajson object containing success data if the crop/capture succeeded1129 * error message otherwise1147 * @return string|null A json object containing success data if the crop/capture succeeded 1148 * error message otherwise. 1130 1149 */ 1131 1150 function bp_avatar_ajax_set() { … … 1241 1260 * Filters 'get_avatar'. 1242 1261 * 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 * 1248 1268 * @return string BP avatar path, if found; else the original avatar path. 1249 1269 */ … … 1307 1327 * 1308 1328 * @param array $file The $_FILES array. 1329 * 1309 1330 * @return bool True if no errors are found. False if there are errors. 1310 1331 */ … … 1320 1341 * 1321 1342 * @param array $file The $_FILES array. 1343 * 1322 1344 * @return bool True if the avatar is under the size limit, otherwise false. 1323 1345 */ … … 1330 1352 1331 1353 /** 1332 * Get allowed avatar types 1333 * 1334 * @since 1354 * Get allowed avatar types. 1355 * 1356 * @since BuddyPress (2.3.0) 1335 1357 */ 1336 1358 function bp_core_get_allowed_avatar_types() { … … 1338 1360 1339 1361 /** 1340 * Use this filter to restrict image types1362 * Filters the list of allowed image types. 1341 1363 * 1342 1364 * @since BuddyPress (2.3.0) 1343 1365 * 1344 * @param array list of image types1366 * @param array $allowed_types List of image types. 1345 1367 */ 1346 1368 $avatar_types = (array) apply_filters( 'bp_core_get_allowed_avatar_types', $allowed_types ); … … 1356 1378 1357 1379 /** 1358 * Get allowed avatar mime types 1359 * 1360 * @since 1380 * Get allowed avatar mime types. 1381 * 1382 * @since BuddyPress (2.3.0) 1361 1383 */ 1362 1384 function bp_core_get_allowed_avatar_mimes() { … … 1382 1404 * 1383 1405 * @param array $file The $_FILES array. 1406 * 1384 1407 * @return bool True if the file extension is permitted, otherwise false. 1385 1408 */ … … 1399 1422 * @since BuddyPress (1.8.0) 1400 1423 * 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 * 1403 1427 * @return string The avatar upload directory path. 1404 1428 */ … … 1474 1498 * Get the absolute upload path for the WP installation. 1475 1499 * 1476 * @uses bp_core_get_upload_dir() To get upload directory info 1500 * @uses bp_core_get_upload_dir() To get upload directory info. 1477 1501 * 1478 1502 * @return string Absolute path to WP upload directory. … … 1515 1539 * 1516 1540 * @param int $user_id ID of the user whose avatar is being checked. 1541 * 1517 1542 * @return bool True if the user has uploaded a local avatar. Otherwise false. 1518 1543 */ … … 1542 1567 * @since BuddyPress (1.5.0) 1543 1568 * 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'. 1546 1571 * @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. 1549 1575 */ 1550 1576 function bp_core_avatar_dimension( $type = 'thumb', $h_or_w = 'height' ) { … … 1557 1583 * @since BuddyPress (1.5.0) 1558 1584 * 1559 * @param int 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'. 1562 1588 */ 1563 1589 return apply_filters( 'bp_core_avatar_dimension', $dim, $type, $h_or_w ); … … 1603 1629 1604 1630 /** 1605 * Get the 'full' avatar width setting 1631 * Get the 'full' avatar width setting. 1606 1632 * 1607 1633 * @since BuddyPress (1.5.0) … … 1683 1709 * @since BuddyPress (1.5.0) 1684 1710 * 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 * 1688 1715 * @return string The URL of the default avatar. 1689 1716 */ … … 1720 1747 * @since BuddyPress (1.5.0) 1721 1748 * 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 * 1725 1753 * @return string The URL of the default avatar thumb. 1726 1754 */ … … 1750 1778 1751 1779 /** 1752 * Reset the week parameter of the WordPress main query if needed 1780 * Reset the week parameter of the WordPress main query if needed. 1753 1781 * 1754 1782 * When cropping an avatar, a $_POST['w'] var is sent, setting the 'week' 1755 1783 * 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. 1757 1785 * 1758 1786 * @since BuddyPress (2.2.0) 1759 1787 * 1760 * @param WP_Query $posts_query the main query object 1788 * @param WP_Query|null $posts_query the main query object. 1789 * 1761 1790 * @uses bp_is_group_create() 1762 1791 * @uses bp_is_group_admin_page() … … 1793 1822 1794 1823 /** 1795 * Checks whether Avatar UI should be loaded 1824 * Checks whether Avatar UI should be loaded. 1796 1825 * 1797 1826 * @since BuddyPress (2.3.0) 1798 1827 * 1799 * @return bool True if Avatar UI should load, false otherwise 1828 * @return bool True if Avatar UI should load, false otherwise. 1800 1829 */ 1801 1830 function bp_avatar_is_front_edit() { … … 1829 1858 * @since BuddyPress (2.3.0) 1830 1859 * 1831 * @ var bool whether to load the Avatar UI1860 * @param bool whether to load the Avatar UI. 1832 1861 */ 1833 1862 return apply_filters( 'bp_avatar_is_front_edit', $retval ); … … 1835 1864 1836 1865 /** 1837 * Checks whether the Webcam Avatar UI part should be loaded 1866 * Checks whether the Webcam Avatar UI part should be loaded. 1838 1867 * 1839 1868 * @since BuddyPress (2.3.0) … … 1867 1896 * by returning false. 1868 1897 * 1869 * @since 1870 * 1871 * @ var bool whether to load Webcam Avatar UI part1898 * @since BuddyPress (2.3.0) 1899 * 1900 * @param bool whether to load Webcam Avatar UI part. 1872 1901 */ 1873 1902 return apply_filters( 'bp_avatar_use_webcam', true ); … … 1875 1904 1876 1905 /** 1877 * Template function to load the Avatar UI javascript templates 1906 * Template function to load the Avatar UI javascript templates. 1878 1907 * 1879 1908 * @since BuddyPress (2.3.0) … … 1888 1917 1889 1918 /** 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. 1891 1920 * 1892 1921 * If the "avatar templates" are not including the new template tag, this will -
trunk/src/bp-core/bp-core-buddybar.php
r10003 r10012 14 14 /** 15 15 * 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 */ 34 function 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) 16 81 * 17 82 * @param array $args { … … 32 97 * @return bool|null Returns false on failure. 33 98 */ 34 function bp_core_new_nav_item( $args = '' ) { 99 function bp_core_create_nav_link( $args = '' ) { 100 $bp = buddypress(); 35 101 36 102 $defaults = array( … … 47 113 $r = wp_parse_args( $args, $defaults ); 48 114 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 } 61 124 62 125 /** 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. 67 151 * 68 * @since BuddyPress ( 1.5.0)152 * @since BuddyPress (2.4.0) 69 153 * 70 154 * @param array $r Parsed arguments for the nav item. … … 72 156 * @param array $defaults Default arguments for a nav item. 73 157 */ 74 do_action( 'bp_core_ new_nav_item', $r, $args, $defaults );75 } 76 77 /** 78 * Add a link to the main BuddyPress navigationarray.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. 79 163 * 80 164 * @since BuddyPress (2.4.0) … … 97 181 * @return bool|null Returns false on failure. 98 182 */ 99 function bp_core_ create_nav_link( $args = '' ) {183 function bp_core_register_nav_screen_function( $args = '' ) { 100 184 $bp = buddypress(); 101 185 … … 113 197 $r = wp_parse_args( $args, $defaults ); 114 198 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, and127 * the logged in user is not the displayed user128 * 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 a172 * 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 admins174 * (those with the 'bp_moderate' cap). Default: false.175 * @type int $position Optional. Numerical index specifying where the item should appear in176 * 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 nav179 * 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 item188 'slug' => false, // URL slug for the nav item189 'item_css_id' => false, // The CSS ID to apply to the HTML of the nav item190 '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 positioned193 'screen_function' => false, // The name of the function to run when clicked194 'default_subnav_slug' => false // The slug of the default subnav item to select when clicked195 );196 197 $r = wp_parse_args( $args, $defaults );198 199 199 // If we don't have the required info we need, don't register this screen function. 200 200 if ( empty( $r['slug'] ) ) { … … 250 250 * @since BuddyPress (1.5.0) 251 251 * 252 * @param string $ default_subnav_slugThe slug of the default subnav item253 * 254 * @param array $r 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. 255 255 */ 256 256 $bp->current_action = apply_filters( 'bp_default_component_subnav', $r['default_subnav_slug'], $r ); … … 275 275 * Modify the default subnav item that loads when a top level nav item is clicked. 276 276 * 277 * @param array $args {277 * @param array|string $args { 278 278 * @type string $parent_slug The slug of the nav item whose default is being changed. 279 279 * @type callable $screen_function The new default callback function that will run when the nav item is clicked. … … 379 379 * Add a subnav item to the BuddyPress navigation. 380 380 * 381 * @param array $args {381 * @param array|string $args { 382 382 * Array describing the new subnav item. 383 383 * @type string $name Display name for the subnav item. … … 423 423 * Add a subnav link to the BuddyPress navigation. 424 424 * 425 * @param array $args {425 * @param array|string $args { 426 426 * Array describing the new subnav item. 427 * @type string $nameDisplay name for the subnav item.428 * @type string $slugUnique URL slug for the subnav item.429 * @type string $parent_slugSlug of the top-level nav item under which the430 * new subnav item should be added.431 * @type string $parent_urlURL of the parent nav item.432 * @type bool|string $item_css_id Optional. 'id' attribute for the nav433 * item. Default: the value of $slug.434 * @type bool $user_has_access Optional. True if the logged-in user has435 * access to thesubnav item, otherwise false. Can be set dynamically436 * when registering the subnav; eg, use bp_is_my_profile() to restrict437 * access to profile owners only. Default: true.438 * @type bool $site_admin_only Optional. Whether the nav item should be439 * visible onlyto site admins (those with the 'bp_moderate' cap).440 * Default: false.441 * @type int $positionOptional. Numerical index specifying where the item442 * should appear in the subnav array. Default: 90.443 * @type callable $screen_functionThe callback function that will run444 * when the nav item is clicked.445 * @type string $linkOptional. The URL that the subnav item should point446 * to. Defaults to a value generated from the $parent_url + $slug.447 * @type bool $show_in_admin_bar Optional. Whether the nav item should be448 * added intothe 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. 450 450 * } 451 * 451 452 * @return bool|null Returns false on failure. 452 453 */ … … 510 511 * Register a screen function, whether or not a related subnav link exists. 511 512 * 512 * @param array $args {513 * @param array|string $args { 513 514 * Array describing the new subnav item. 514 * @type string $slugUnique URL slug for the subnav item.515 * @type string $parent_slugSlug of the top-level nav item under which the516 * new subnav item should be added.517 * @type string $parent_urlURL of the parent nav item.518 * @type bool $user_has_access Optional. True if the logged-in user has519 * access to thesubnav item, otherwise false. Can be set dynamically520 * when registering the subnav; eg, use bp_is_my_profile() to restrict521 * access to profile owners only. Default: true.522 * @type bool $site_admin_only Optional. Whether the nav item should be523 * visibleonly to site admins (those with the 'bp_moderate' cap).524 * Default: false.525 * @type int $positionOptional. Numerical index specifying where the item526 * should appear in the subnav array. Default: 90.527 * @type callable $screen_function The callback function that will run528 * when the nav item is clicked.529 * @type string $link Optional. The URL that the subnav item should point530 * to.Defaults to a value generated from the $parent_url + $slug.531 * @type bool $show_in_admin_bar Optional. Whether the nav item should be532 * added intothe 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. 534 535 * } 536 * 535 537 * @return bool|null Returns false on failure. 536 538 */ … … 592 594 * 593 595 * @param array $subnav_item The subnav array added to bp_options_nav in `bp_core_new_subnav_item()`. 596 * 594 597 * @return array 595 598 */ … … 724 727 * @param string $nav_item The slug of the top-level nav item whose subnav items you're checking. 725 728 * Default: the current component slug. 729 * 726 730 * @return bool $has_subnav True if the nav item is found and has subnav items; false otherwise. 727 731 */ … … 749 753 * 750 754 * @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. 752 757 */ 753 758 function bp_core_remove_nav_item( $parent_id ) { … … 823 828 * @param string $context Context of this preference check. 'admin' or 'front'. 824 829 * @param int $user Optional. ID of the user to check. Default: 0 (which falls back to the logged-in user's ID). 830 * 825 831 * @return bool True if the toolbar should be showing for this user. 826 832 */ -
trunk/src/bp-core/bp-core-cache.php
r9819 r10012 17 17 * When wp-super-cache is installed this function will clear cached pages 18 18 * so that success/error messages are not cached, or time sensitive content. 19 * 20 * @return int 19 21 */ 20 22 function bp_core_clear_cache() { … … 35 37 /** 36 38 * Clear all cached objects for a user, or those that a user is part of. 39 * 40 * @param string $user_id 37 41 */ 38 42 function bp_core_clear_user_object_cache( $user_id ) { … … 126 130 * @since BuddyPress (2.0.0) 127 131 * 128 * @param array $item_idsID list.132 * @param array $item_ids ID list. 129 133 * @param string $cache_group The cache group to check against. 134 * 130 135 * @return array 131 136 */ … … 154 159 * @since BuddyPress (1.6.0) 155 160 * 156 * @global $wpdb WordPress database object for queries..161 * @global object $wpdb WordPress database object for queries.. 157 162 * 158 163 * @param array $args { 159 164 * 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_typeThe type of object, eg 'groups' or 'activity'.163 * @type string $meta_tableThe name of the metadata table being queried.164 * @type string $object_column Optional. The name of the database column165 * 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 creating168 * 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. 169 174 * } 175 * 170 176 * @return array|bool Metadata cache for the specified objects, or false on failure. 171 177 */ … … 180 186 'object_column' => '', // DB column for the object ids (group_id, etc) 181 187 'cache_key_prefix' => '' // Prefix to use when creating cache key names. Eg 182 //'bp_groups_groupmeta'188 // 'bp_groups_groupmeta' 183 189 ); 184 190 $r = wp_parse_args( $args, $defaults ); -
trunk/src/bp-core/bp-core-caps.php
r9957 r10012 12 12 13 13 /** 14 * Return an array of roles from the currently loaded blog 14 * Return an array of roles from the currently loaded blog. 15 15 * 16 16 * WordPress roles are dynamically flipped when calls to switch_to_blog() and … … 133 133 * args. 134 134 * 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 * 139 140 * @return array Actual capabilities for meta capability. See {@link WP_User::has_cap()}. 140 141 */ … … 186 187 * 187 188 * @param string $role The role for which you're loading caps. 189 * 188 190 * @return array Capabilities for $role. 189 191 */ … … 273 275 * @type mixed $a,... Optional. Extra arguments applicable to the capability check. 274 276 * } 277 * 275 278 * @return bool True if the user has the cap for the given parameters. 276 279 */ … … 335 338 * @see WP_User::has_cap() 336 339 * 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 * 340 345 * @return array $allcaps The user's cap list, with 'bp_moderate' appended, if relevant. 341 346 */ -
trunk/src/bp-core/bp-core-catchuri.php
r9914 r10012 370 370 * 371 371 * @param array $templates Array of templates to attempt to load. 372 * 372 373 * @return bool|null Returns false on failure. 373 374 */ … … 518 519 * @since BuddyPress (1.5.0) 519 520 * 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." 531 531 * } 532 532 */ … … 606 606 * @since BuddyPress (1.5.0) 607 607 * 608 * @global $error Error message to pass to wp-login.php608 * @global string $error Error message to pass to wp-login.php. 609 609 */ 610 610 function bp_core_no_access_wp_login_error() { … … 716 716 * Optional array of arguments. 717 717 * @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. 719 719 * } 720 * 720 721 * @return string Canonical URL for the current page. 721 722 */ -
trunk/src/bp-core/bp-core-component.php
r9847 r10012 109 109 110 110 /** 111 * Metadata tables for the component (if applicable) 111 * Metadata tables for the component (if applicable). 112 112 * 113 113 * @since BuddyPress (2.0.0) … … 118 118 119 119 /** 120 * Global tables for the component (if applicable) 120 * Global tables for the component (if applicable). 121 121 * 122 122 * @since BuddyPress (2.0.0) … … 141 141 * @param array $params { 142 142 * 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". 144 144 * @type array $features An array of feature names. This is used to load additional files from your 145 145 * component directory and for feature active checks. eg. array( 'awesome' ) … … 331 331 * 332 332 * @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. 334 334 */ 335 335 public function includes( $includes = array() ) { … … 455 455 * in the $sub_nav parameter array should be formatted. 456 456 * 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 in460 * which is passed to bp_core_new_subnav_item(). See that461 * 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. 462 462 */ 463 463 public function setup_nav( $main_nav = array(), $sub_nav = array() ) { … … 490 490 * @see WP_Admin_Bar::add_menu() for a description of the syntax 491 491 * required by each item in the $wp_admin_nav parameter array. 492 * @global obj $wp_admin_bar493 * 494 * @param array $wp_admin_nav An array of nav item arguments. Each item 495 * in this parameterarray is passed to {@link WP_Admin_Bar::add_menu()}.496 * See that method for a description of the required syntax for497 * 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. 498 498 */ 499 499 public function setup_admin_bar( $wp_admin_nav = array() ) { … … 747 747 748 748 /** 749 * Add any permalink structures 749 * Add any permalink structures. 750 750 * 751 751 * @since BuddyPress (1.9) 752 752 * 753 * @uses do_action() Calls 'bp_{@link bp_Component::name}_add_permastruct' 753 * @uses do_action() Calls 'bp_{@link bp_Component::name}_add_permastruct'. 754 754 */ 755 755 public function add_permastructs() { … … 766 766 767 767 /** 768 * Allow components to parse the main query 768 * Allow components to parse the main query. 769 769 * 770 770 * @since BuddyPress (1.9) 771 771 * 772 772 * @uses do_action() Calls 'bp_{@link bp_Component::name}_parse_query' 773 * @param object The main WP_Query773 * @param object $query The main WP_Query. 774 774 */ 775 775 public function parse_query( $query ) { … … 788 788 789 789 /** 790 * Generate any additional rewrite rules 790 * Generate any additional rewrite rules. 791 791 * 792 792 * @since BuddyPress (1.5) 793 793 * 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'. 795 795 */ 796 796 public function generate_rewrite_rules() { -
trunk/src/bp-core/bp-core-cssjs.php
r9819 r10012 121 121 122 122 /** 123 * Enqueues the css and js required by the Avatar UI 123 * Enqueues the css and js required by the Avatar UI. 124 124 * 125 125 * @since BuddyPress (2.3.0) … … 316 316 * @since BuddyPress (2.0.0) 317 317 * 318 * @uses apply_filters() to allow other component to load extra dependencies 318 * @uses apply_filters() to allow other component to load extra dependencies. 319 319 * 320 320 * @return array The JavaScript dependencies. -
trunk/src/bp-core/bp-core-dependency.php
r9819 r10012 488 488 * 489 489 * @param array $query_vars See {@link WP::parse_request()}. 490 * 490 491 * @return array $query_vars See {@link WP::parse_request()}. 491 492 */ … … 507 508 * @since BuddyPress (1.7.0) 508 509 * 509 * @param string $redirect_to See 'login_redirect'.510 * @param string $redirect_to See 'login_redirect'. 510 511 * @param string $redirect_to_raw See 'login_redirect'. 512 * 511 513 * @param bool $user See 'login_redirect'. 512 514 * … … 537 539 * 538 540 * @param string $template See 'template_include'. 541 * 539 542 * @return string Template file to use. 540 543 */ … … 580 583 * 581 584 * @uses apply_filters() Calls 'bp_allowed_themes' with the allowed themes list. 585 * 586 * @param array $themes 587 * 588 * @return array 582 589 */ 583 590 function bp_allowed_themes( $themes ) { … … 596 603 597 604 /** 598 * The main action used for handling theme-side POST requests 605 * The main action used for handling theme-side POST requests. 599 606 * 600 607 * @since BuddyPress (1.9.0) … … 639 646 640 647 /** 641 * The main action used for handling theme-side GET requests 648 * The main action used for handling theme-side GET requests. 642 649 * 643 650 * @since BuddyPress (1.9.0) -
trunk/src/bp-core/bp-core-filters.php
r9848 r10012 75 75 * 76 76 * @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 * 78 79 * @return array The exclude list, with BP's pages added. 79 80 */ … … 114 115 * @uses buddypress() gets BuddyPress main instance 115 116 * 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. 118 120 */ 119 121 function bp_core_exclude_pages_from_nav_menu_admin( $object = null ) { … … 157 159 * @since BuddyPress (2.2.0) 158 160 * 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 * 161 164 * @return array 162 165 */ … … 214 217 * @since BuddyPress (2.2.0) 215 218 * 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 * 218 222 * @return array 219 223 */ … … 258 262 * 259 263 * @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 * 261 266 * @return array $comments The modified comment array. 262 267 */ … … 297 302 * are redirected to on login. 298 303 * 299 * @param string $redirect_to The URL to be redirected to, sanitized300 * 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 successfully303 * 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 * 304 309 * @return string The redirect URL. 305 310 */ … … 323 328 * @since BuddyPress (1.6.0) 324 329 * 325 330 * @param bool $value Whether or not to redirect. 326 331 * @param string $redirect_to Sanitized URL to be redirected to. 327 332 * @param string $redirect_to_raw Unsanitized URL to be redirected to. … … 366 371 * 367 372 * @param string $welcome_email Complete email passed through WordPress. 373 * 368 374 * @return string Filtered $welcome_email with the password replaced 369 * by '[User Set]'.375 * by '[User Set]'. 370 376 */ 371 377 function bp_core_filter_user_welcome_email( $welcome_email ) { … … 400 406 * 401 407 * @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 * 405 412 * @return string Filtered $welcome_email with $password replaced by '[User Set]'. 406 413 */ … … 429 436 * @see wpmu_signup_blog_notification() for a description of parameters. 430 437 * 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. 435 442 * @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 * 439 447 * @return bool True on success, false on failure. 440 448 */ … … 511 519 * @param string $subject Subject used in the notification email. 512 520 * @param string $message Message used in the notification email. 513 * @param string domainThe new blog domain.521 * @param string $domain The new blog domain. 514 522 * @param string $path The new blog path. 515 523 * @param string $title The site title. … … 531 539 * @see wpmu_signup_user_notification() for a full description of params. 532 540 * 533 * @param string $user The user's login name.541 * @param string $user The user's login name. 534 542 * @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. 538 547 */ 539 548 function bp_core_activation_signup_user_notification( $user, $user_email, $key, $meta ) { … … 825 834 * 826 835 * @param string $title_part 836 * 827 837 * @return string 828 838 */ … … 842 852 * 843 853 * @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. 845 856 */ 846 857 function bp_setup_nav_menu_item( $menu_item ) { … … 927 938 * 928 939 * @param string $q SQL query. 940 * 929 941 * @return string 930 942 */ … … 952 964 953 965 /** 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. 955 967 * 956 968 * @since BuddyPress (2.1.0) … … 958 970 * @param string $edit_link The edit link. 959 971 * @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 962 975 */ 963 976 function bp_core_filter_edit_post_link( $edit_link = '', $post_id = 0 ) { … … 973 986 * mentions suggestions? 974 987 * 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. 976 991 * @param bool $mentions_enabled True if mentions are enabled. 992 * 977 993 * @return bool True if mentions scripts should be loaded. 978 * @since BuddyPress (2.2.0)979 994 */ 980 995 function bp_maybe_load_mentions_scripts_for_blog_content( $load_mentions, $mentions_enabled ) { -
trunk/src/bp-core/bp-core-functions.php
r9819 r10012 1044 1044 * the time elapsed. Enter either as an integer Unix timestamp, or as a 1045 1045 * date string of the format 'Y-m-d h:i:s'. 1046 * @param int $newer_date Optional. Unix timestamp of date to compare older1046 * @param int|bool $newer_date Optional. Unix timestamp of date to compare older 1047 1047 * date to. Default: false (current time). 1048 1048 * @return string String representing the time since the older date, eg … … 1462 1462 * @uses apply_filters() Filter 'bp_get_user_meta_key' to modify keys individually. 1463 1463 * 1464 * @param string $key The usermeta meta_key.1464 * @param string|bool $key The usermeta meta_key. 1465 1465 * @return string $key The usermeta meta_key. 1466 1466 */ -
trunk/src/bp-core/bp-core-moderation.php
r9819 r10012 27 27 * 28 28 * @param int $user_id User id to check for flood. 29 * 29 30 * @return bool True if there is no flooding, false if there is. 30 31 */ … … 58 59 * @uses bp_current_user_can() Allow super admins to bypass blacklist. 59 60 * 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. 62 63 * @param string $content The content being posted. 64 * 63 65 * @return bool True if test is passed, false if fail. 64 66 */ … … 192 194 * @uses bp_current_user_can() Allow super admins to bypass blacklist. 193 195 * 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. 196 198 * @param string $content The content being posted. 199 * 197 200 * @return bool True if test is passed, false if fail. 198 201 */ … … 331 334 * @since BuddyPress (1.6.0) 332 335 * 333 * @param string $retval Current user's user-agent 336 * @param string $retval Current user's user-agent. 334 337 */ 335 338 return apply_filters( 'bp_core_current_user_ua', $retval ); -
trunk/src/bp-core/bp-core-options.php
r9828 r10012 218 218 * @since BuddyPress (1.6.0) 219 219 * 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. 222 223 */ 223 224 function bp_pre_get_option( $value = false ) { … … 252 253 * 253 254 * @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 * 256 258 * @return mixed The value for the option. 257 259 */ … … 278 280 * 279 281 * @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 * 281 284 * @return bool True on success, false on failure. 282 285 */ … … 297 300 * 298 301 * @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 * 300 304 * @return bool True on success, false on failure. 301 305 */ … … 316 320 * 317 321 * @param string $option_name The option key to be deleted. 322 * 318 323 * @return bool True on success, false on failure. 319 324 */ … … 331 336 * 332 337 * @deprecated 1.6.0 338 * 339 * @param array $keys 340 * 341 * @return bool 333 342 */ 334 343 function bp_core_activate_site_options( $keys = array() ) { … … 495 504 * 496 505 * @param string $option Name of the option key. 506 * 497 507 * @return mixed Value, if found. 498 508 */ … … 522 532 * 523 533 * @param bool $default Optional. Fallback value if not found in the database. 524 * Default: true. 534 * Default: true. 535 * 525 536 * @return bool True if profile sync is enabled, otherwise false. 526 537 */ … … 545 556 * 546 557 * @param bool $default Optional. Fallback value if not found in the database. 547 * Default: true. 558 * Default: true. 559 * 548 560 * @return bool True if the admin bar should be hidden for logged-out users, 549 * otherwise false.561 * otherwise false. 550 562 */ 551 563 function bp_hide_loggedout_adminbar( $default = true ) { … … 569 581 * 570 582 * @param bool $default Optional. Fallback value if not found in the database. 571 * Default: true. 583 * Default: true. 584 * 572 585 * @return bool True if avatar uploads are disabled, otherwise false. 573 586 */ … … 592 605 * @since BuddyPress (2.3.0) 593 606 * 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 * 596 610 * @return bool True if group avatar uploads are disabled, otherwise false. 597 611 */ … … 626 640 * 627 641 * @param bool $default Optional. Fallback value if not found in the database. 628 * Default: true. 642 * Default: true. 643 * 629 644 * @return bool True if users are able to delete their own accounts, otherwise 630 * false.645 * false. 631 646 */ 632 647 function bp_disable_account_deletion( $default = false ) { … … 651 666 * 652 667 * @param bool $default Optional. Fallback value if not found in the database. 653 * Default: false. 668 * Default: false. 669 * 654 670 * @return bool True if activity comments are disabled for blog and forum 655 * items, otherwise false.671 * items, otherwise false. 656 672 */ 657 673 function bp_disable_blogforum_comments( $default = false ) { … … 676 692 * 677 693 * @param bool $default Optional. Fallback value if not found in the database. 678 * Default: true. 694 * Default: true. 695 * 679 696 * @return bool True if group creation is restricted, otherwise false. 680 697 */ … … 699 716 * 700 717 * @param bool $default Optional. Fallback value if not found in the database. 701 * Default: true. 718 * Default: true. 719 * 702 720 * @return bool True if the BuddyBar should be forced on, otherwise false. 703 721 */ … … 719 737 * @since BuddyPress (1.6.0) 720 738 * 721 * @param bool $default Optional. Default: '0'.739 * @param bool|string $default Optional. Default: '0'. 722 740 */ 723 741 function bp_group_forums_root_id( $default = '0' ) { … … 731 749 * @uses bp_get_option() To get the root forum ID from the database. 732 750 * 733 * @param bool $default Optional. Default: '0'. 751 * @param bool|string $default Optional. Default: '0'. 752 * 734 753 * @return int The ID of the group forums root forum. 735 754 */ … … 754 773 * 755 774 * @param bool $default Optional. Fallback value if not found in the database. 756 * Default: true. 775 * Default: true. 776 * 757 777 * @return bool True if group forums are active, otherwise false. 758 778 */ … … 777 797 * 778 798 * @param bool $default Optional. Fallback value if not found in the database. 779 * Default: true. 799 * Default: true. 800 * 780 801 * @return bool True if Akismet is enabled, otherwise false. 781 802 */ … … 800 821 * 801 822 * @param bool $default Optional. Fallback value if not found in the database. 802 * Default: true. 823 * Default: true. 824 * 803 825 * @return bool True if Heartbeat refresh is enabled, otherwise false. 804 826 */ … … 822 844 * @uses get_option() To get the theme package option. 823 845 * 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 * 826 849 * @return string ID of the theme package. 827 850 */ -
trunk/src/bp-core/bp-core-taxonomy.php
r9819 r10012 35 35 * @param string $taxonomy Taxonomy name. 36 36 * @param bool $append Optional. True to append terms to existing terms. Default: false. 37 * 37 38 * @return array Array of term taxonomy IDs. 38 39 */ … … 63 64 * @param string|array $taxonomies Name or names of taxonomies to match. 64 65 * @param array $args See {@see wp_get_object_terms()}. 66 * 65 67 * @return array 66 68 */ … … 91 93 * @param string|array $terms Term or terms to remove. 92 94 * @param string $taxonomy Taxonomy name. 95 * 93 96 * @return bool|WP_Error True on success, false or WP_Error on failure. 94 97 */ -
trunk/src/bp-core/bp-core-template-loader.php
r9819 r10012 24 24 * @uses get_template_part() 25 25 * 26 * @param string $slug Template part slug. Used to generate filenames, eg27 * 'friends' for 'friends.php'.26 * @param string $slug Template part slug. Used to generate filenames, 27 * eg 'friends' for 'friends.php'. 28 28 * @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 * 30 31 * @return string Path to located template. See {@link bp_locate_template()}. 31 32 */ 32 33 function bp_get_template_part( $slug, $name = null ) { 33 34 34 // Execute code for this part35 35 /** 36 36 * Fires at the start of bp_get_template_part(). … … 52 52 $templates[] = $slug . '.php'; 53 53 54 // Allow template parts to be filtered55 54 /** 56 55 * Filters the template parts to be loaded. … … 78 77 * 79 78 * @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 * 84 84 * @return string The template filename if one is located. 85 85 */ … … 146 146 * 147 147 * @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 * 150 151 * @return bool See {@link add_filter()}. 151 152 */ … … 169 170 * 170 171 * @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 * 173 175 * @return bool See {@link remove_filter()}. 174 176 */ … … 194 196 * @since BuddyPress (1.7.0) 195 197 * 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 * 200 203 * @return array The filtered value after all hooked functions are applied to it. 201 204 */ … … 254 257 * @param string $slug See {@link bp_get_template_part()}. 255 258 * @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 * 258 262 * @return string|null If $echo, returns the template content. 259 263 */ … … 294 298 * @uses bp_set_theme_compat_template() 295 299 * 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 * 298 303 * @return string Full path to file. 299 304 */ … … 337 342 338 343 /** 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. 344 351 */ 345 352 function bp_get_template_locations( $templates = array() ) { … … 367 374 * 368 375 * @param array $stacks Array of template locations. 376 * 369 377 * @return array() Array of all template locations registered so far. 370 378 */ … … 434 442 * Listens to the 'template_include' filter and waits for any BuddyPress specific 435 443 * 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. 437 445 * 438 446 * Note that the _edit() checks are ahead of their counterparts, to prevent them … … 442 450 * 443 451 * @param string $template 452 * 444 453 * @return string The path to the template file that is being used. 445 454 */ … … 478 487 * 479 488 * @param mixed $template Default: false. 489 * 480 490 * @return mixed False if empty. Template name if template included. 481 491 */ … … 490 500 * 491 501 * @since BuddyPress (1.8.0) 502 * 492 503 * @return bool True if yes, false if no. 493 504 */ -
trunk/src/bp-core/bp-core-template.php
r9989 r10012 26 26 * @uses bp_get_user_nav() Renders the navigation for a profile of a currently 27 27 * viewed user. 28 * 29 * @param string $parent_slug 30 * 31 * @return string 28 32 */ 29 33 function bp_get_options_nav( $parent_slug = '' ) { … … 111 115 * @since BuddyPress (2.0.0) 112 116 * 117 * @param string $component 118 * 113 119 * @return string 114 120 */ … … 335 341 * @since BuddyPress (1.1.0) 336 342 * 337 * @param int $time The UNIX timestamp to be formatted.343 * @param int|string $time The UNIX timestamp to be formatted. 338 344 * @param bool $exclude_time Optional. True to return only the month + day, false 339 345 * to return month, day, and time. Default: false. … … 702 708 * @see bp_get_button() 703 709 * 704 * @param array $args See {@link BP_Button}.710 * @param array|string $args See {@link BP_Button}. 705 711 */ 706 712 function bp_button( $args = '' ) { … … 712 718 * @see BP_Button for a description of arguments and return value. 713 719 * 714 * @param array $args See {@link BP_Button}.720 * @param array|string $args See {@link BP_Button}. 715 721 * @return string HTML markup for the button. 716 722 */ … … 1108 1114 * WordPress theme without coping the functions from functions.php. 1109 1115 * 1110 * @param string $object1116 * @param string|bool $object 1111 1117 * @return string The AJAX querystring. 1112 1118 */ … … 1178 1184 * Return the name of the current item. 1179 1185 * 1180 * @return unknown1186 * @return string|bool 1181 1187 */ 1182 1188 function bp_current_item() { … … 1423 1429 * @since BuddyPress (1.5.0) 1424 1430 * 1425 * @ paramstring BP_SEARCH_SLUG The search slug. Default "search".1431 * @const string BP_SEARCH_SLUG The search slug. Default "search". 1426 1432 */ 1427 1433 return apply_filters( 'bp_get_search_slug', BP_SEARCH_SLUG ); … … 1597 1603 * 1598 1604 * @param string $action_variable The action_variable being tested against. 1599 * @param int $position Optional. The array key you're testing against. If you1605 * @param int|bool $position Optional. The array key you're testing against. If you 1600 1606 * don't provide a $position, the function will return true if the 1601 1607 * $action_variable is found *anywhere* in the action variables array. … … 1755 1761 * already deprecated functions. 1756 1762 * 1763 * @param string $component_name 1764 * 1757 1765 * @return bool True if root component, else false. 1758 1766 */ … … 1793 1801 * @since BuddyPress (1.5.0) 1794 1802 * 1795 * @global $current_blog WordPress global for the current blog.1803 * @global int $current_blog WordPress global for the current blog. 1796 1804 * 1797 1805 * @param string $component Optional. Name of the component to check for. … … 2692 2700 * Not currently used by BuddyPress. 2693 2701 * 2702 * @param string $component Current component to check for. 2703 * @param string $callback Callback to invoke. 2704 * 2694 2705 * @return bool 2695 2706 */ … … 2724 2735 /** 2725 2736 * 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.2732 2737 */ 2733 2738 function bp_the_body_class() { 2734 2739 echo bp_get_the_body_class(); 2735 2740 } 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 */ 2736 2750 function bp_get_the_body_class( $wp_classes = array(), $custom_classes = false ) { 2737 2751 -
trunk/src/bp-core/bp-core-theme-compatibility.php
r9819 r10012 39 39 * @param array $properties { 40 40 * 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 given43 * 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. 44 44 * @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. 48 48 * } 49 49 */ … … 61 61 * 62 62 * @since BuddyPress (1.7.0) 63 * 64 * @param array $properties Array of properties for BP_Theme_Compat. 63 65 */ 64 66 public function __construct( Array $properties = array() ) { … … 110 112 * 111 113 * @param string $property Property name. 112 * @param mixed $value Property value. 114 * @param mixed $value Property value. 115 * 113 116 * @return bool True on success, false on failure. 114 117 */ … … 123 126 * 124 127 * @param string $property Property name. 128 * 125 129 * @return mixed The value of the property if it exists, otherwise an 126 * empty string.130 * empty string. 127 131 */ 128 132 public function __get( $property ) { … … 370 374 * 371 375 * @param bool $set True to set the flag to true, false to set it to false. 376 * 372 377 * @return bool Returns the value of $set. 373 378 */ … … 387 392 * 388 393 * @param array $templates The template stack. 394 * 389 395 * @return array The template stack (value of $templates). 390 396 */ … … 404 410 * 405 411 * @param string $template The template currently in use. 412 * 406 413 * @return string The template currently in use (value of $template). 407 414 */ … … 421 428 * 422 429 * @param string $template The template originally selected by WP. 430 * 423 431 * @return string The template originally selected by WP (value of $template). 424 432 */ … … 435 443 * 436 444 * @param string $template The template name to check. 445 * 437 446 * @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. 439 448 */ 440 449 function bp_is_theme_compat_original_template( $template = '' ) { … … 458 467 * @see BP_Theme_Compat for a description of the $theme parameter arguments. 459 468 * 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. 463 472 */ 464 473 function bp_register_theme_package( $theme = array(), $override = true ) { … … 497 506 * @global object $post Current post object. 498 507 * 499 * @param array $args Array of optional arguments. Arguments parallel the 500 * propertiesof {@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. 501 510 */ 502 511 function bp_theme_compat_reset_post( $args = array() ) { … … 635 644 * 636 645 * @param string $template Template name. 646 * 637 647 * @return string $template Template name. 638 648 */ … … 708 718 * 709 719 * @param string $content Original post content. 720 * 710 721 * @return string $content Post content, potentially modified. 711 722 */ … … 753 764 * 754 765 * @return bool True if the_content is currently in the process of being 755 * filtered and replaced.766 * filtered and replaced. 756 767 */ 757 768 function bp_do_theme_compat() { … … 772 783 * @global array $merged_filters 773 784 * 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 * 778 790 * @return bool True on success. 779 791 */ … … 827 839 * @global array $merged_filters 828 840 * 829 * @param string $tagThe tag to which filters should be restored.830 * @param int $priority Optional. If present, only those filters that were831 * originally attached to the tag with $priority will be restored.832 * Otherwise, all available filters will be restored, regardless of833 * 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 * 834 846 * @return bool True on success. 835 847 */ … … 880 892 * @since BuddyPress (1.7.0) 881 893 * 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 * 884 897 * @return bool True if open, false if closed. 885 898 */ … … 917 930 * 918 931 * @param string $retval The current post content. 932 * 933 * @return string $retval 919 934 */ 920 935 function bp_theme_compat_toggle_is_page( $retval = '' ) { -
trunk/src/bp-core/bp-core-update.php
r9849 r10012 60 60 * 61 61 * @uses buddypress() 62 * 63 * @param string $basename BuddyPress basename. 62 64 * 63 65 * @return bool True if activating BuddyPress, false if not. … … 105 107 * 106 108 * @uses buddypress() 109 * 110 * @param string $basename BuddyPress basename. 107 111 * 108 112 * @return bool True if deactivating BuddyPress, false if not. … … 397 401 * 398 402 * - 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. 401 405 * 402 406 * @since BuddyPress (2.0.0) … … 429 433 430 434 /** 431 * 2.0.1 database upgrade routine 435 * 2.0.1 database upgrade routine. 432 436 * 433 437 * @since BuddyPress (2.0.1) … … 445 449 * 2.2.0 update routine. 446 450 * 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. 450 454 * 451 455 * @since BuddyPress (2.2.0) … … 470 474 * 2.3.0 update routine. 471 475 * 472 * - Add notifications meta table 476 * - Add notifications meta table. 473 477 * 474 478 * @since BuddyPress (2.3.0) … … 519 523 520 524 /** 521 * Remove all hidden friendship activities 525 * Remove all hidden friendship activities. 522 526 * 523 527 * @since BuddyPress (2.2.0) 524 528 * 525 * @uses bp_activity_delete() to delete the corresponding friendship activities 529 * @uses bp_activity_delete() to delete the corresponding friendship activities. 526 530 */ 527 531 function bp_cleanup_friendship_activities() { … … 568 572 * @global WPDB $wpdb 569 573 * 570 * @return bool If signups table exists574 * @return bool|null If signups table exists. 571 575 */ 572 576 function bp_core_maybe_install_signups() { -
trunk/src/bp-core/bp-core-widgets.php
r9819 r10012 46 46 * @see WP_Widget::widget() for description of parameters. 47 47 * 48 * @param array $args Widget arguments.48 * @param array $args Widget arguments. 49 49 * @param array $instance Widget settings, as saved by the user. 50 50 */ … … 148 148 * @param array $new_instance The new instance options. 149 149 * @param array $old_instance The old instance options. 150 * 150 151 * @return array $instance The parsed options to be saved. 151 152 */ … … 160 161 * Output the login widget options form. 161 162 * 162 * @param $instance Settings for this widget. 163 * @param array $instance Settings for this widget. 164 * 165 * @return string 163 166 */ 164 167 public function form( $instance = array() ) { -
trunk/src/bp-core/bp-core-wpabstraction.php
r9819 r10012 19 19 * 20 20 * @global string $wp_version 21 * 21 22 * @return string $wp_version 22 23 */ … … 127 128 * @todo Why is this function defined in this file? 128 129 * 129 * @param string $prefix Global table prefix.130 * @param string|bool $prefix Global table prefix. 130 131 * @return string SQL chunk. 131 132 */ … … 177 178 * @param string $needle String to search for. 178 179 * @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. 180 181 * @return int|bool Position of needle in haystack if found, else false. 181 182 */ … … 201 202 * @param string $needle String to search for. 202 203 * @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. 204 205 * @return int Position of last needle in haystack if found, else false. 205 206 */ -
trunk/src/bp-core/classes/class-bp-attachment-avatar.php
r9831 r10012 1 1 <?php 2 2 /** 3 * Core Avatars attachment class 3 * Core Avatars attachment class. 4 4 * 5 5 * @package BuddyPress … … 11 11 12 12 /** 13 * BP Attachment Avatar class 13 * BP Attachment Avatar class. 14 14 * 15 * Extends BP Attachment to manage the avatar uploads 15 * Extends BP Attachment to manage the avatar uploads. 16 16 * 17 17 * @since BuddyPress (2.3.0) … … 20 20 21 21 /** 22 * Construct Upload parameters 22 * Construct Upload parameters. 23 23 * 24 24 * @since BuddyPress (2.3.0) … … 46 46 47 47 /** 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. 52 55 */ 53 56 public static function get_avatar_types( $allowed_types = array() ) { … … 58 61 59 62 /** 60 * Set Upload Dir data for avatars 63 * Set Upload Dir data for avatars. 61 64 * 62 65 * @since BuddyPress (2.3.0) … … 78 81 79 82 /** 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 * 88 90 * @uses bp_core_check_avatar_size() 89 91 * @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. 91 96 */ 92 97 public function validate_upload( $file = array() ) { … … 110 115 111 116 /** 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 * 117 121 * @uses bp_core_avatar_original_max_width() 118 122 * @uses wp_get_image_editor() 123 * 124 * @param string $file the absolute path to the file. 125 * 119 126 * @return mixed 120 127 */ … … 157 164 158 165 /** 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 * 164 170 * @uses bp_core_avatar_full_width() 165 171 * @uses bp_core_avatar_full_height() 172 * 173 * @param string $file the absolute path to the file. 174 * 166 175 * @return boolean 167 176 */ … … 179 188 180 189 /** 181 * Crop the avatar 190 * Crop the avatar. 182 191 * 183 192 * @since BuddyPress (2.3.0) 184 193 * 185 194 * @see BP_Attachment::crop for the list of parameters 186 * @param array $args187 195 * @uses bp_core_fetch_avatar() 188 196 * @uses bp_core_delete_existing_avatar() … … 191 199 * @uses bp_core_avatar_dimension() 192 200 * @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). 194 205 */ 195 206 public function crop( $args = array() ) { … … 274 285 275 286 /** 276 * Get the user id to set its avatar 277 * 278 * @since BuddyPress (2.3.0) 279 * 280 * @return integer the user ID287 * Get the user id to set its avatar. 288 * 289 * @since BuddyPress (2.3.0) 290 * 291 * @return integer The user ID. 281 292 */ 282 293 private function get_user_id() { … … 296 307 297 308 /** 298 * Get the group id to set its avatar 299 * 300 * @since BuddyPress (2.3.0) 301 * 302 * @return integer the group id309 * Get the group id to set its avatar. 310 * 311 * @since BuddyPress (2.3.0) 312 * 313 * @return integer The group ID. 303 314 */ 304 315 private function get_group_id() { … … 313 324 314 325 /** 315 * Build script datas for the Uploader UI 316 * 317 * @since BuddyPress (2.3.0) 318 * 319 * @return array the javascript localization data326 * Build script datas for the Uploader UI. 327 * 328 * @since BuddyPress (2.3.0) 329 * 330 * @return array The javascript localization data. 320 331 */ 321 332 public function script_data() { … … 375 386 ); 376 387 } else { 388 377 389 /** 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. 380 392 * 381 393 * @since BuddyPress (2.3.0) 382 394 * 383 * @param array the avatar specific BuddyPress parameters395 * @param array $value The avatar specific BuddyPress parameters. 384 396 */ 385 397 $script_data['bp_params'] = apply_filters( 'bp_attachment_avatar_params', array() ); … … 398 410 399 411 /** 400 * Use this filter to override/extend the avatar script data 412 * Use this filter to override/extend the avatar script data. 401 413 * 402 414 * @since BuddyPress (2.3.0) 403 415 * 404 * @param array $script_data the avatar script data405 * @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). 406 418 */ 407 419 return apply_filters( 'bp_attachment_avatar_script_data', $script_data, $object ); -
trunk/src/bp-core/classes/class-bp-attachment.php
r9874 r10012 11 11 12 12 /** 13 * BP Attachment class 13 * BP Attachment class. 14 14 * 15 15 * Extend it to manage your component's uploads. … … 22 22 23 23 /** 24 * The file being uploaded 24 * The file being uploaded. 25 25 * 26 26 * @var array … … 30 30 /** 31 31 * The default args to be merged with the 32 * ones passed by the child class 32 * ones passed by the child class. 33 33 * 34 34 * @var array … … 45 45 46 46 /** 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 { 52 52 * @type int $original_max_filesize Maximum file size in kilobytes. Defaults to php.ini settings. 53 53 * @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'. 56 56 * @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). 59 59 * @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' ). 61 61 * } 62 62 * @uses sanitize_key() … … 107 107 * @since BuddyPress (2.3.0) 108 108 * 109 * @uses 109 * @uses bp_upload_dir() 110 110 */ 111 111 public function set_upload_dir() { … … 140 140 141 141 /** 142 * Set Upload error messages 142 * Set Upload error messages. 143 143 * 144 144 * Used into the $overrides argument of BP_Attachment->upload() … … 146 146 * @since BuddyPress (2.3.0) 147 147 * 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 * 149 150 * @return array the list of upload errors 150 151 */ … … 176 177 177 178 /** 178 * Include the WordPress core needed files 179 * Include the WordPress core needed files. 179 180 * 180 181 * @since BuddyPress (2.3.0) … … 191 192 192 193 /** 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 * 200 202 * @uses wp_handle_upload() To upload the file 201 203 * @uses add_filter() To temporarly overrides WordPress uploads data … … 247 249 248 250 /** 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. 250 252 * 251 * @ var array $overrides the wp_handle_upload overrides253 * @param array $overrides The wp_handle_upload overrides 252 254 */ 253 255 $overrides = apply_filters( 'bp_attachment_upload_overrides', $overrides ); … … 286 288 287 289 /** 288 * Validate the allowed mime types using WordPress allowed mime types 290 * Validate the allowed mime types using WordPress allowed mime types. 289 291 * 290 292 * In case of a multisite, the mime types are already restricted by … … 312 314 313 315 /** 314 * Specific upload rules 316 * Specific upload rules. 315 317 * 316 318 * Override this function from your child class to build your specific rules … … 322 324 * @since BuddyPress (2.3.0) 323 325 * 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. 326 329 */ 327 330 public function validate_upload( $file = array() ) { … … 340 343 341 344 /** 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. 349 353 */ 350 354 public function upload_dir_filter() { 355 351 356 /** 352 357 * Filters the component's upload directory. … … 367 372 368 373 /** 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. 372 377 * (eg: add an .htaccess file) 373 378 * 374 379 * @since BuddyPress (2.3.0) 375 380 * 376 * @uses 381 * @uses wp_mkdir_p() 377 382 */ 378 383 public function create_dir() { … … 396 401 397 402 /** 398 * Crop an image file 403 * Crop an image file. 399 404 * 400 405 * @since BuddyPress (2.3.0) … … 402 407 * @param array $args { 403 408 * @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. 412 417 * } 413 418 * @uses wp_crop_image() 419 * 414 420 * @return string|WP_Error New filepath on success, WP_Error on failure. 415 421 */ … … 495 501 496 502 /** 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 data503 * 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. 504 510 */ 505 511 public function script_data() { -
trunk/src/bp-core/classes/class-bp-button.php
r9819 r10012 17 17 * @param array $args { 18 18 * 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: ''. 43 45 * } 44 46 */ … … 153 155 * @since BuddyPress (1.2.6) 154 156 * 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}. 158 158 */ 159 159 public function __construct( $args = '' ) { -
trunk/src/bp-core/classes/class-bp-core-notification.php
r9819 r10012 21 21 22 22 /** 23 * The notification id 24 * 25 * @var int eger23 * The notification id. 24 * 25 * @var int 26 26 */ 27 27 public $id; … … 30 30 * The ID to which the notification relates to within the component. 31 31 * 32 * @var int eger32 * @var int 33 33 */ 34 34 public $item_id; … … 37 37 * The secondary ID to which the notification relates to within the component. 38 38 * 39 * @var int eger39 * @var int 40 40 */ 41 41 public $secondary_item_id = null; … … 44 44 * The user ID for who the notification is for. 45 45 * 46 * @var int eger46 * @var int 47 47 */ 48 48 public $user_id; … … 81 81 * Constructor 82 82 * 83 * @param int eger$id83 * @param int $id 84 84 */ 85 85 public function __construct( $id = 0 ) { … … 93 93 * Update or insert notification details into the database. 94 94 * 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. 97 98 */ 98 99 public function save() { … … 123 124 * Fetches the notification data from the database. 124 125 * 125 * @global wpdb $wpdb WordPress database object 126 * @global wpdb $wpdb WordPress database object. 126 127 */ 127 128 public function populate() { … … 143 144 /** Static Methods ********************************************************/ 144 145 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 */ 145 154 public static function check_access( $user_id, $notification_id ) { 146 155 global $wpdb; … … 155 164 * 156 165 * @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 * 159 170 * @return array Associative array 160 171 * @static … … 175 186 * Delete all the notifications for a user based on the component name and action. 176 187 * 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 179 191 * @param string $component_name 180 192 * @param string $component_action 181 * @static 193 * 194 * @static 195 * 196 * @return mixed 182 197 */ 183 198 public static function delete_for_user_by_type( $user_id, $component_name, $component_action ) { … … 192 207 * Delete all the notifications that have a specific item id, component name and action. 193 208 * 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 201 220 */ 202 221 public static function delete_for_user_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false ) { … … 215 234 * Deletes all the notifications sent by a specific user, by component and action. 216 235 * 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. 220 240 * @param string $component_action The action of the component the notification was sent from. 221 241 * @static 242 * 243 * @return mixed 222 244 */ 223 245 public static function delete_from_user_by_type( $user_id, $component_name, $component_action ) { … … 230 252 231 253 /** 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. 238 262 * @param string $secondary_item_id Optional secondary item id that the notifications are to have. 239 263 * @static 264 * 265 * @return mixed 240 266 */ 241 267 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 54 54 55 55 /** 56 * The full name of the user 56 * The full name of the user. 57 57 * 58 58 * @var string … … 100 100 101 101 /** 102 * The total number of blog posts posted by the user 102 * The total number of blog posts posted by the user. 103 103 * 104 104 * @var integer … … 129 129 * Class constructor. 130 130 * 131 * @param integer $user_id The ID for the user being queried.132 * @param bool $populate_extras Whether to fetch extra information133 * such asgroup/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. 134 134 */ 135 135 public function __construct( $user_id, $populate_extras = false ) { … … 228 228 * are used there in the same way. 229 229 * 230 * @param string $typeSee {@link BP_User_Query}.231 * @param int $limitSee {@link BP_User_Query}. Default: 0.232 * @param int $pageSee {@link BP_User_Query}. Default: 1.233 * @param int $user_idSee {@link BP_User_Query}. Default: 0.234 * @param mixed $includeSee {@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 $excludeSee {@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. 244 244 * @return array { 245 * @type int $total_users Total number of users matched by query246 * params.245 * @type int $total_users Total number of users matched by query 246 * params. 247 247 * @type array $paged_users The current page of users matched by 248 * query params.248 * query params. 249 249 * } 250 250 */ … … 444 444 * @global wpdb $wpdb WordPress database object. 445 445 * 446 * @param string $letter The letter the users names are to start with.447 * @param int $limitThe number of users we wish to retrive.448 * @param int $page The page number we are currently on, used in449 * conjunction with $limit to get the start position for the450 * limit.451 * @param bool $populate_extras Populate extra user fields?452 * @param string $exclude Comma-separated IDs of users whose results453 * 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 * 454 454 * @return mixed False on error, otherwise associative array of results. 455 455 */ … … 531 531 * 532 532 * @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 * 538 540 * @return array Associative array. 539 541 */ … … 626 628 * @global wpdb $wpdb WordPress database object. 627 629 * 628 * @param string $search_termsThe terms to search the profile table629 * value column for.630 * @param int eger $limitThe limit of results we want.631 * @param int eger $pageThe 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. 632 634 * @param boolean $populate_extras Populate extra user fields? 635 * 633 636 * @return array Associative array. 634 637 */ … … 686 689 * @global wpdb $wpdb WordPress database object. 687 690 * 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 * 691 695 * @return mixed False on error, otherwise associative array of results. 692 696 */ … … 773 777 * @global wpdb $wpdb WordPress database object. 774 778 * 775 * @param integer $user_id User ID. 779 * @param int $user_id User ID. 780 * 776 781 * @return array Associative array. 777 782 */ … … 789 794 * 790 795 * @param int|array User IDs or multiple user IDs. 796 * 791 797 * @return array 792 798 */ … … 836 842 * @since BuddyPress (2.0.0) 837 843 * 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 * 840 847 * @return bool True on success, false on failure. 841 848 */ … … 926 933 * 927 934 * @param int $user_id 935 * 928 936 * @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. 930 938 */ 931 939 public static function delete_last_activity( $user_id ) { -
trunk/src/bp-core/classes/class-bp-date-query.php
r9819 r10012 34 34 * Constructor. 35 35 * 36 * @param array $date_query 37 * @param string $column 38 * 36 39 * @see WP_Date_Query::__construct() 37 40 */ … … 55 58 * Registers our date column with WP Date Query to pass validation. 56 59 * 57 * @param array $retval Current DB columns 60 * @param array $retval Current DB columns. 61 * 58 62 * @return array 59 63 */ -
trunk/src/bp-core/classes/class-bp-embed.php
r9819 r10012 81 81 * @uses WP_Embed::maybe_make_link() 82 82 * 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 * 85 86 * @return string The embed HTML on success, otherwise the original URL. 86 87 */ … … 170 171 * oEmbed failure. 171 172 * 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 * 177 179 * @return string The embed HTML on success, otherwise the original URL. 178 180 */ -
trunk/src/bp-core/classes/class-bp-media-extractor.php
r9819 r10012 13 13 * Extracts media from text. Use {@link extract()}. 14 14 * 15 * @since BuddyPress (2.3.0) 16 * 15 17 * The supported types are links, mentions, images, shortcodes, embeds, audio, video, and "all". 16 18 * This is what each type extracts: … … 18 20 * Links: <a href="http://example.com"> 19 21 * Mentions: @name 20 * If the Activity component is enabled, we use it to parse out any @names. A consequence22 * If the Activity component is enabled, we use it to parse out any at-names. A consequence 21 23 * 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 matching24 * at-name, then it isn't extracted. 25 * If the Activity component is disabled, any at-name is extracted (both those matching 24 26 * real accounts, and those made-up). 25 27 * Images: <img src="image.gif">, [gallery], [gallery ids="2,3"], featured images (Post thumbnails). … … 35 37 * 36 38 * @see BP_Media_Extractor::extract() Use this to extract media. 37 * @since BuddyPress (2.3.0)38 39 */ 39 40 class BP_Media_Extractor { … … 57 58 * Extract media from text. 58 59 * 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 * 62 66 * @return array { 63 67 * @type array $has Extracted media counts. { … … 74 78 * 75 79 * @type string $source Media source. Either "html" or "shortcodes". 76 * @type string $url Link to audio.80 * @type string $url Link to audio. 77 81 * } 78 82 * @type array $embeds Extracted oEmbeds. { … … 84 88 * Array of extracted media. 85 89 * 86 * @type int $gallery_id Gallery ID. Optional, not always set.87 * @type int $heightWidth 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 $widthWidth 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. 91 95 * } 92 96 * @type array $links Extracted URLs. { … … 98 102 * Array of extracted media. 99 103 * 100 * @type string $name @mention.104 * @type string $name @mention. 101 105 * @type string $user_id User ID. Optional, only set if Activity component enabled. 102 106 * } … … 104 108 * Array of extracted media. 105 109 * 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. 110 114 * } 111 115 * @type array $videos Extracted video. { … … 113 117 * 114 118 * @type string $source Media source. Currently only "shortcodes". 115 * @type string $url Link to audio.119 * @type string $url Link to audio. 116 120 * } 117 121 * } 118 * @since BuddyPress (2.3.0)119 122 */ 120 123 public function extract( $richtext, $what_to_extract = self::ALL, $extra_args = array() ) { … … 168 171 * Filters media extracted from text. 169 172 * 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. 176 180 */ 177 181 return apply_filters( 'bp_media_extractor_extract', $media, $richtext, $what_to_extract, $extra_args, $plaintext ); … … 188 192 * Extract `<a href>` tags from text. 189 193 * 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 * 193 200 * @return array { 194 201 * @type array $has Extracted media counts. { … … 201 208 * } 202 209 * } 203 * @since BuddyPress (2.3.0)204 210 */ 205 211 protected function extract_links( $richtext, $plaintext, $extra_args = array() ) { … … 228 234 * Filters links extracted from text. 229 235 * 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. 235 242 */ 236 243 return apply_filters( 'bp_media_extractor_links', $data, $richtext, $plaintext, $extra_args ); … … 245 252 * If the Activity component is disabled, any @mentions are extracted. 246 253 * 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 * 250 260 * @return array { 251 261 * @type array $has Extracted media counts. { … … 255 265 * Array of extracted media. 256 266 * 257 * @type string $name @mention.267 * @type string $name @mention. 258 268 * @type string $user_id User ID. Optional, only set if Activity component enabled. 259 269 * } 260 270 * } 261 * @since BuddyPress (2.3.0)262 271 */ 263 272 protected function extract_mentions( $richtext, $plaintext, $extra_args = array() ) { … … 300 309 * Filters @mentions extracted from text. 301 310 * 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). 307 317 */ 308 318 return apply_filters( 'bp_media_extractor_mentions', $data, $richtext, $plaintext, $extra_args ); … … 314 324 * If an image is in the Media Library, then its resolution is included in the results. 315 325 * 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 * 319 332 * @return array { 320 333 * @type array $has Extracted media counts. { … … 324 337 * Array of extracted media. 325 338 * 326 * @type int $gallery_id Gallery ID. Optional, not always set.327 * @type int $heightWidth 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 $widthWidth 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. 331 344 * } 332 345 * } 333 * @since BuddyPress (2.3.0)334 346 */ 335 347 protected function extract_images( $richtext, $plaintext, $extra_args = array() ) { … … 416 428 * Filters images extracted from text. 417 429 * 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. 423 436 */ 424 437 return apply_filters( 'bp_media_extractor_images', $media, $richtext, $plaintext, $extra_args ); … … 431 444 * For example, [gallery] and [audio]. 432 445 * 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 * 436 452 * @return array { 437 453 * @type array $has Extracted media counts. { … … 441 457 * Array of extracted media. 442 458 * 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. 447 463 * } 448 464 * } 449 * @since BuddyPress (2.3.0)450 465 */ 451 466 protected function extract_shortcodes( $richtext, $plaintext, $extra_args = array() ) { … … 477 492 * Filters shortcodes extracted from text. 478 493 * 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. 484 501 */ 485 502 return apply_filters( 'bp_media_extractor_shortcodes', $data, $richtext, $plaintext, $extra_args ); … … 489 506 * Extract any URL, matching a registered oEmbed endpoint, from text. 490 507 * 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 * 494 514 * @return array { 495 515 * @type array $has Extracted media counts. { … … 502 522 * } 503 523 * } 504 * @since BuddyPress (2.3.0)505 524 */ 506 525 protected function extract_embeds( $richtext, $plaintext, $extra_args = array() ) { … … 552 571 * Filters embeds extracted from text. 553 572 * 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. 559 579 */ 560 580 return apply_filters( 'bp_media_extractor_embeds', $data, $richtext, $plaintext, $extra_args ); … … 564 584 * Extract [audio] shortcodes and `<a href="*.mp3">` tags, from text. 565 585 * 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 * 569 594 * @return array { 570 595 * @type array $has Extracted media counts. { … … 575 600 * 576 601 * @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. 579 604 * } 580 605 * } 581 * @see wp_get_audio_extensions() for supported audio formats.582 * @since BuddyPress (2.3.0)583 606 */ 584 607 protected function extract_audio( $richtext, $plaintext, $extra_args = array() ) { … … 646 669 * Filters audio extracted from text. 647 670 * 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. 653 677 */ 654 678 return apply_filters( 'bp_media_extractor_audio', $data, $richtext, $plaintext, $extra_args ); … … 658 682 * Extract [video] shortcodes from text. 659 683 * 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 * 663 692 * @return array { 664 693 * @type array $has Extracted media counts. { … … 669 698 * 670 699 * @type string $source Media source. Currently only "shortcodes". 671 * @type string $url Link to audio.700 * @type string $url Link to audio. 672 701 * } 673 702 * } 674 * @see wp_get_video_extensions() for supported video formats.675 * @since BuddyPress (2.3.0)676 703 */ 677 704 protected function extract_video( $richtext, $plaintext, $extra_args = array() ) { … … 718 745 * Filters videos extracted from text. 719 746 * 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. 725 753 */ 726 754 return apply_filters( 'bp_media_extractor_videos', $data, $richtext, $plaintext, $extra_args ); … … 735 763 * Extract images in [galleries] shortcodes from text. 736 764 * 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 * 740 771 * @return array 741 * @since BuddyPress (2.3.0)742 772 */ 743 773 protected function extract_images_from_galleries( $richtext, $plaintext, $extra_args = array() ) { … … 820 850 * Filters image galleries extracted from text. 821 851 * 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. 827 858 */ 828 859 return apply_filters( 'bp_media_extractor_galleries', $galleries_data, $richtext, $plaintext, $extra_args ); … … 832 863 * Extract the featured image from a Post. 833 864 * 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 * 837 871 * @return array 838 * @since BuddyPress (2.3.0)839 872 */ 840 873 protected function extract_images_from_featured_images( $richtext, $plaintext, $extra_args ) { … … 869 902 * Filters featured images extracted from a WordPress Post. 870 903 * 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. 876 910 */ 877 911 return apply_filters( 'bp_media_extractor_featured_images', $image, $richtext, $plaintext, $extra_args ); … … 883 917 * HTML tags and shortcodes are removed, and HTML entities are decoded. 884 918 * 919 * @since BuddyPress (2.3.0) 920 * 885 921 * @param string $richtext 922 * 886 923 * @return string 887 * @since BuddyPress (2.3.0)888 924 */ 889 925 protected function strip_markup( $richtext ) { … … 893 929 * Filters the generated plain text version of the content passed to the extractor. 894 930 * 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. 898 935 */ 899 936 return apply_filters( 'bp_media_extractor_strip_markup', $plaintext, $richtext ); -
trunk/src/bp-core/classes/class-bp-members-suggestions.php
r9819 r10012 25 25 * @since BuddyPress (2.1.0) 26 26 * @var array $args { 27 * @type int $limitMaximum 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. 31 31 * } 32 32 */ … … 42 42 * Validate and sanitise the parameters for the suggestion service query. 43 43 * 44 * @since BuddyPress (2.1.0) 45 * 44 46 * @return true|WP_Error If validation fails, return a WP_Error object. On success, return true (bool). 45 * @since BuddyPress (2.1.0)46 47 */ 47 48 public function validate() { … … 77 78 * Find and return a list of username suggestions that match the query. 78 79 * 80 * @since BuddyPress (2.1.0) 81 * 79 82 * @return array|WP_Error Array of results. If there were problems, returns a WP_Error object. 80 * @since BuddyPress (2.1.0)81 83 */ 82 84 public function get_suggestions() { -
trunk/src/bp-core/classes/class-bp-recursive-query.php
r9819 r10012 38 38 * @access protected 39 39 * 40 * @param string $primary_table41 * @param string $primary_id_column42 40 * @return array 43 41 */ … … 144 142 * @access public 145 143 * 146 * @param array $queries Array of query clauses. 144 * @param array $queries Array of query clauses. 145 * 147 146 * @return array Sanitized array of query clauses. 148 147 */ … … 211 210 * @access protected 212 211 * 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 * 215 215 * @return array { 216 216 * @type array $join Array of subclauses for the JOIN statement. … … 228 228 * @access protected 229 229 * 230 * @param array $q Clause to check. 230 * @param array $query Clause to check. 231 * 231 232 * @return bool 232 233 */ -
trunk/src/bp-core/classes/class-bp-suggestions.php
r9819 r10012 70 70 * 71 71 * @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. 76 76 * } 77 77 * @since BuddyPress (2.1.0) … … 87 87 * If validation fails, you must return a WP_Error object. 88 88 * 89 * @since BuddyPress (2.1.0) 90 * 89 91 * @return true|WP_Error If validation fails, return a WP_Error object. On success, return true (bool). 90 * @since BuddyPress (2.1.0)91 92 */ 92 93 public function validate() { … … 134 135 * For example: { 'ID': 'admin', 'image': 'http://example.com/logo.png', 'name': 'Name Surname' } 135 136 * 137 * @since BuddyPress (2.1.0) 138 * 136 139 * @return array|WP_Error Array of results. If there were problems, returns a WP_Error object. 137 * @since BuddyPress (2.1.0)138 140 */ 139 141 abstract public function get_suggestions(); -
trunk/src/bp-core/classes/class-bp-user-query.php
r9977 r10012 42 42 * @type array|string $member_type__in Array or comma-separated list of member types to limit results to. 43 43 * @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. 45 45 * @type string|bool $meta_key Limit results to users that have usermeta associated with this meta_key. 46 46 * Usually used with $meta_value. Default: false. … … 619 619 * @since BuddyPress (1.8.0) 620 620 * 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 * 623 624 * @return array The list of users to which the main query should be 624 * limited.625 * limited. 625 626 */ 626 627 public function get_include_ids( $include = array() ) { … … 759 760 * @param string|array $member_types Array or comma-separated list of member types. 760 761 * @param string $operator 'IN' or 'NOT IN'. 762 * 763 * @return string 761 764 */ 762 765 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 14 14 * 15 15 * 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. 17 17 * 18 18 * @since BuddyPress (1.9.0) … … 25 25 * @see Walker_Nav_Menu::__construct() for a description of parameters. 26 26 * 27 * @param array $fields See {@link Walker_Nav_Menu::__construct()}.27 * @param array|bool $fields See {@link Walker_Nav_Menu::__construct()}. 28 28 */ 29 29 public function __construct( $fields = false ) { … … 39 39 * 40 40 * @param string $output See {@Walker_Nav_Menu::start_lvl()}. 41 * @param int $depthSee {@Walker_Nav_Menu::start_lvl()}.42 * @param array $argsSee {@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()}. 43 43 */ 44 44 public function start_lvl( &$output, $depth = 0, $args = array() ) { … … 53 53 * 54 54 * @param string $output See {@Walker_Nav_Menu::end_lvl()}. 55 * @param int $depthSee {@Walker_Nav_Menu::end_lvl()}.56 * @param array $argsSee {@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()}. 57 57 */ 58 58 public function end_lvl( &$output, $depth = 0, $args = array() ) { … … 66 66 * @see Walker::start_el() for description of parameters. 67 67 * 68 * @param string $output Passed by reference. Used to append additional69 * content.70 * @param object $itemMenu item data object.71 * @param int $depthDepth of menu item. Used for padding.72 * @param object $argsSee {@Walker::start_el()}.73 * @param int $idSee {@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()}. 74 74 */ 75 75 function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { -
trunk/src/bp-core/classes/class-bp-walker-nav-menu.php
r9819 r10012 50 50 * @see Walker::walk() 51 51 * 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 * 54 55 * @return string See {@link Walker::walk()}. 55 56 */ … … 79 80 80 81 /* 81 * need to display in hierarchical order82 * Need to display in hierarchical order 82 83 * separate elements into two buckets: top level and children elements 83 84 * children_elements is two dimensional array, eg. … … 96 97 97 98 /* 98 * when none of the elements is top level99 * 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. 100 101 */ 101 102 if ( empty( $top_level_elements ) ) { … … 135 136 * Display the current <li> that we are on. 136 137 * 137 * @see Walker::start_el() for complete description of parameters 138 * @see Walker::start_el() for complete description of parameters. 138 139 * 139 140 * @since BuddyPress (1.7.0) 140 141 * 141 142 * @param string $output Passed by reference. Used to append 142 * additional content.143 * @param object $item Menu item data object.144 * @param int $depthDepth of menu item. Used for padding. Optional,145 * defaults to 0.146 * @param array $argsOptional. See {@link Walker::start_el()}.147 * @param int $current_pageMenu 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. 148 149 */ 149 150 public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { -
trunk/src/bp-core/deprecated/1.5.php
r9819 r10012 31 31 * @deprecated BuddyPress (1.5) 32 32 * @deprecated Use is_multisite() 33 * 34 * @return bool 33 35 */ 34 36 function bp_core_is_multisite() { … … 45 47 * @deprecated Use is_main_site() 46 48 * @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) 48 50 * @return bool True if not multisite or $blog_id is main site 49 51 * @since BuddyPress (1.2.6) … … 54 56 } 55 57 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 user62 * @return bool True if is super admin63 */64 58 if ( !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 */ 65 67 function is_site_admin( $user_id = false ) { 66 68 _deprecated_function( __FUNCTION__, '1.5', 'is_super_admin()' ); … … 78 80 * @deprecated Use add_menu_page(). 79 81 * @since BuddyPress (1.1) 82 * 83 * @return string 80 84 */ 81 85 function bp_core_add_admin_menu_page( $args = '' ) { … …