Changeset 10497
- Timestamp:
- 02/03/2016 05:01:13 AM (9 years ago)
- Location:
- trunk/src/bp-core
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-admin.php
r10492 r10497 16 16 * Load BuddyPress plugin admin area. 17 17 * 18 * @package BuddyPress19 * @subpackage CoreAdministration20 18 * @todo Break this apart into each applicable Component. 21 19 * … … 29 27 * Path to the BuddyPress admin directory. 30 28 * 29 * @since 1.6.0 31 30 * @var string $admin_dir 32 31 */ … … 38 37 * URL to the BuddyPress admin directory. 39 38 * 39 * @since 1.6.0 40 40 * @var string $admin_url 41 41 */ … … 45 45 * URL to the BuddyPress images directory. 46 46 * 47 * @since 1.6.0 47 48 * @var string $images_url 48 49 */ … … 52 53 * URL to the BuddyPress admin CSS directory. 53 54 * 55 * @since 1.6.0 54 56 * @var string $css_url 55 57 */ … … 59 61 * URL to the BuddyPress admin JS directory. 60 62 * 63 * @since 1.6.0 61 64 * @var string 62 65 */ … … 68 71 * Notices used for user feedback, like saving settings. 69 72 * 73 * @since 1.9.0 70 74 * @var array() 71 75 */ … … 931 935 */ 932 936 $styles = apply_filters( 'bp_core_admin_register_styles', array( 933 // Legacy 937 // Legacy. 934 938 'bp-admin-common-css' => array( 935 939 'file' => $common_css, -
trunk/src/bp-core/bp-core-attachments.php
r10425 r10497 44 44 $upload_data = bp_upload_dir(); 45 45 46 // Return empty string, if Uploads data are not available 46 // Return empty string, if Uploads data are not available. 47 47 if ( ! $upload_data ) { 48 48 return $retval; … … 584 584 * Enqueues the script needed for the Uploader UI. 585 585 * 586 * @since 2.3.0 587 * 586 588 * @see BP_Attachment::script_data() && BP_Attachment_Avatar::script_data() for examples showing how 587 589 * to set specific script data. 588 *589 * @since 2.3.0590 590 * 591 591 * @param string $class Name of the class extending BP_Attachment (eg: BP_Attachment_Avatar). … … 1065 1065 * @since 2.4.0 1066 1066 * 1067 * @param array $args {1067 * @param array $args { 1068 1068 * @type string $file The absolute path to the image. Required. 1069 1069 * @type string $component The component for the object (eg: groups, xprofile). Required. -
trunk/src/bp-core/bp-core-avatars.php
r10496 r10497 13 13 /** 14 14 * Set up the constants we need for avatar support. 15 * 16 * @since 1.2.0 15 17 */ 16 18 function bp_core_set_avatar_constants() { … … 105 107 * add_filter( 'bp_core_fetch_avatar_no_grav', '__return_true' ); 106 108 * 109 * @since 1.1.0 107 110 * @since 2.4.0 Added 'extra_attr', 'scheme', 'rating' and 'force_default' for $args. 108 111 * These are inherited from WordPress 4.2.0. See {@link get_avatar()}. … … 634 637 $url_args['r'] = strtolower( $params['rating'] ); 635 638 } 636 // Only set default image if 'Gravatar Logo' is not requested 639 // Only set default image if 'Gravatar Logo' is not requested. 637 640 if ( 'gravatar_default' !== $default_grav ) { 638 641 $url_args['d'] = $default_grav; … … 674 677 /** 675 678 * Delete an existing avatar. 679 * 680 * @since 1.1.0 676 681 * 677 682 * @param array|string $args { … … 819 824 * location. 820 825 * 826 * @since 1.1.0 827 * 821 828 * @see bp_core_check_avatar_upload() 822 829 * @see bp_core_check_avatar_type() … … 1117 1124 * crop_x - The horizontal starting point of the crop 1118 1125 * crop_y - The vertical starting point of the crop 1126 * 1127 * @since 1.1.0 1119 1128 * 1120 1129 * @param array|string $args { … … 1318 1327 * See 'get_avatar' filter description in wp-includes/pluggable.php. 1319 1328 * 1329 * @since 1.1.0 1320 1330 * @since 2.4.0 Added $args parameter to coincide with WordPress 4.2.0. 1321 1331 * … … 1414 1424 * Is the current avatar upload error-free? 1415 1425 * 1426 * @since 1.0.0 1427 * 1416 1428 * @param array $file The $_FILES array. 1417 1429 * @return bool True if no errors are found. False if there are errors. … … 1426 1438 /** 1427 1439 * Is the file size of the current avatar upload permitted? 1440 * 1441 * @since 1.0.0 1428 1442 * 1429 1443 * @param array $file The $_FILES array. … … 1478 1492 * 1479 1493 * Permitted file types are JPG, GIF and PNG. 1494 * 1495 * @since 1.0.0 1480 1496 * 1481 1497 * @param array $file The $_FILES array. … … 1566 1582 * Get the absolute upload path for the WP installation. 1567 1583 * 1584 * @since 1.2.0 1585 * 1568 1586 * @uses bp_core_get_upload_dir() To get upload directory info. 1569 1587 * … … 1584 1602 /** 1585 1603 * Get the raw base URL for root site upload location. 1604 * 1605 * @since 1.2.0 1586 1606 * 1587 1607 * @uses bp_core_get_upload_dir() To get upload directory info. … … 1850 1870 * @since 2.2.0 1851 1871 * 1852 * @param WP_Query|null $posts_query the main query object.1853 *1854 1872 * @uses bp_is_group_create() 1855 1873 * @uses bp_is_group_admin_page() … … 1857 1875 * @uses bp_action_variable() to check for the group's avatar creation step 1858 1876 * @uses bp_is_user_change_avatar() to check for the user's change profile screen 1877 * 1878 * @param WP_Query|null $posts_query The main query object. 1859 1879 */ 1860 1880 function bp_core_avatar_reset_query( $posts_query = null ) { … … 1934 1954 * @global $is_safari 1935 1955 * @global $is_IE 1956 * 1936 1957 * @return bool True to load the Webcam Avatar UI part. False otherwise. 1937 1958 */ -
trunk/src/bp-core/bp-core-buddybar.php
r10487 r10497 15 15 /** 16 16 * Add an item to the main BuddyPress navigation array. 17 * 18 * @since 1.1.0 17 19 * 18 20 * @param array|string $args { … … 270 272 * Modify the default subnav item that loads when a top level nav item is clicked. 271 273 * 274 * @since 1.1.0 275 * 272 276 * @param array|string $args { 273 277 * @type string $parent_slug The slug of the nav item whose default is being changed. … … 340 344 * The sorting is split into a separate function because it can only happen 341 345 * after all plugins have had a chance to register their navigation items. 346 * 347 * @since 1.0.0 342 348 * 343 349 * @return bool|null Returns false on failure. … … 373 379 /** 374 380 * Add a subnav item to the BuddyPress navigation. 381 * 382 * @since 1.1.0 375 383 * 376 384 * @param array|string $args { … … 419 427 /** 420 428 * Add a subnav link to the BuddyPress navigation. 429 * 430 * @since 2.4.0 421 431 * 422 432 * @param array|string $args { … … 507 517 * Register a screen function, whether or not a related subnav link exists. 508 518 * 519 * @since 2.4.0 520 * 509 521 * @param array|string $args { 510 522 * Array describing the new subnav item. … … 682 694 * Sort all subnavigation arrays. 683 695 * 696 * @since 1.1.0 697 * 684 698 * @return bool|null Returns false on failure. 685 699 */ … … 745 759 * Remove a nav item from the navigation array. 746 760 * 761 * @since 1.0.0 762 * 747 763 * @param int $parent_id The slug of the parent navigation item. 748 764 * @return bool Returns false on failure, ie if the nav item can't be found. … … 774 790 * Remove a subnav item from the navigation array. 775 791 * 792 * @since 1.0.0 793 * 776 794 * @param string $parent_id The slug of the parent navigation item. 777 795 * @param string $slug The slug of the subnav item to be removed. … … 800 818 * Clear all subnav items from a specific nav item. 801 819 * 820 * @since 1.0.0 821 * 802 822 * @param string $parent_slug The slug of the parent navigation item. 803 823 */ -
trunk/src/bp-core/bp-core-cache.php
r10417 r10497 17 17 * Prune the WP Super Cache. 18 18 * 19 * When WP Super Cache is installed, this function will clear cached pages 20 * so that success/error messages or time-sensitive content are not cached. 21 * 22 * @since 1.0.0 23 * 19 24 * @see prune_super_cache() 20 *21 * When wp-super-cache is installed this function will clear cached pages22 * so that success/error messages are not cached, or time sensitive content.23 25 * 24 26 * @return int … … 42 44 * Clear all cached objects for a user, or those that a user is part of. 43 45 * 46 * @since 1.0.0 47 * 44 48 * @param string $user_id User ID to delete cache for. 45 49 */ … … 50 54 /** 51 55 * Clear member count caches and transients. 56 * 57 * @since 1.6.0 52 58 */ 53 59 function bp_core_clear_member_count_caches() { -
trunk/src/bp-core/bp-core-caps.php
r10417 r10497 335 335 * Plugin authors: Please do not use this function; thank you. :) 336 336 * 337 * @since 1.6.0 338 * 337 339 * @access private 338 * @since 1.6.0339 340 * 340 341 * @see WP_User::has_cap() -
trunk/src/bp-core/bp-core-catchuri.php
r10487 r10497 25 25 * - OUTSIDE ROOT: http:// example.com / sites / buddypress / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ... 26 26 * 27 * 27 * Example: 28 28 * - http://example.com/members/andy/profile/edit/group/5/ 29 29 * - $bp->current_component: string 'xprofile' … … 78 78 } 79 79 80 // If running off blog other than root, any subdirectory names must be 81 // removed from $bp_uri. This includes two cases: 82 // 83 // 1. when WP is installed in a subdirectory, 84 // 2. when BP is running on secondary blog of a subdirectory 85 // multisite installation. Phew! 80 /* 81 * If running off blog other than root, any subdirectory names must be 82 * removed from $bp_uri. This includes two cases: 83 * 84 * 1. when WP is installed in a subdirectory, 85 * 2. when BP is running on secondary blog of a subdirectory 86 * multisite installation. Phew! 87 */ 86 88 if ( is_multisite() && !is_subdomain_install() && ( bp_is_multiblog_mode() || 1 != bp_get_root_blog_id() ) ) { 87 89 … … 131 133 $bp_uri = array_merge( array(), $bp_uri ); 132 134 133 // If a component is set to the front page, force its name into $bp_uri 134 // so that $current_component is populated (unless a specific WP post is being requested 135 // via a URL parameter, usually signifying Preview mode). 135 /* 136 * If a component is set to the front page, force its name into $bp_uri 137 * so that $current_component is populated (unless a specific WP post is being requested 138 * via a URL parameter, usually signifying Preview mode). 139 */ 136 140 if ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_on_front' ) && empty( $bp_uri ) && empty( $_GET['p'] ) && empty( $_GET['page_id'] ) ) { 137 141 $post = get_post( get_option( 'page_on_front' ) ); … … 391 395 * wp-content/themes/[activated_theme]/members/index.php 392 396 * 397 * @since 1.0.0 398 * 393 399 * @param array $templates Array of templates to attempt to load. 394 400 */ … … 494 500 /** 495 501 * Redirect away from /profile URIs if XProfile is not enabled. 502 * 503 * @since 1.0.0 496 504 */ 497 505 function bp_core_catch_profile_uri() { -
trunk/src/bp-core/bp-core-component.php
r10417 r10497 38 38 * Unique ID for the component. 39 39 * 40 * @since 1.5.0 40 41 * @var string $id 41 42 */ … … 45 46 * Unique slug for the component, for use in query strings and URLs. 46 47 * 48 * @since 1.5.0 47 49 * @var string $slug 48 50 */ … … 52 54 * Does the component need a top-level directory? 53 55 * 56 * @since 1.5.0 54 57 * @var bool $has_directory 55 58 */ … … 59 62 * The path to the component's files. 60 63 * 64 * @since 1.5.0 61 65 * @var string $path 62 66 */ … … 66 70 * The WP_Query loop for this component. 67 71 * 72 * @since 1.5.0 68 73 * @var WP_Query $query 69 74 */ … … 73 78 * The current ID of the queried object. 74 79 * 80 * @since 1.5.0 75 81 * @var string $current_id 76 82 */ … … 80 86 * Callback for formatting notifications. 81 87 * 88 * @since 1.5.0 82 89 * @var callable $notification_callback 83 90 */ … … 87 94 * WordPress Toolbar links. 88 95 * 96 * @since 1.5.0 89 97 * @var array $admin_menu 90 98 */ … … 94 102 * Placeholder text for component directory search box. 95 103 * 96 * @since 1. 5.0104 * @since 1.6.0 97 105 * @var string $search_string 98 106 */ … … 102 110 * Root slug for the component. 103 111 * 104 * @since 1. 5.0112 * @since 1.6.0 105 113 * @var string $root_slug 106 114 */ … … 465 473 * Set up component navigation. 466 474 * 475 * @since 1.5.0 476 * 467 477 * @see bp_core_new_nav_item() For a description of the $main_nav 468 478 * parameter formatting. … … 503 513 * Set up the component entries in the WordPress Admin Bar. 504 514 * 515 * @since 1.5.0 516 * 505 517 * @see WP_Admin_Bar::add_menu() for a description of the syntax 506 518 * required by each item in the $wp_admin_nav parameter array. -
trunk/src/bp-core/bp-core-cssjs.php
r10417 r10497 108 108 /** 109 109 * Load the JS for "Are you sure?" .confirm links. 110 * 111 * @since 1.1.0 110 112 */ 111 113 function bp_core_confirmation_js() { … … 161 163 /** 162 164 * Enqueues jCrop library and hooks BP's custom cropper JS. 165 * 166 * @since 1.1.0 163 167 */ 164 168 function bp_core_add_jquery_cropper() { … … 171 175 /** 172 176 * Output the inline JS needed for the cropper to work on a per-page basis. 177 * 178 * @since 1.1.0 173 179 */ 174 180 function bp_core_add_cropper_inline_js() { … … 273 279 /** 274 280 * Output the inline CSS for the BP image cropper. 281 * 282 * @since 1.1.0 275 283 */ 276 284 function bp_core_add_cropper_inline_css() { -
trunk/src/bp-core/bp-core-dependency.php
r10431 r10497 23 23 /** 24 24 * Fire the 'bp_include' action, where plugins should include files. 25 * 26 * @since 1.2.5 25 27 */ 26 28 function bp_include() { … … 36 38 /** 37 39 * Fire the 'bp_setup_components' action, where plugins should initialize components. 40 * 41 * @since 1.6.0 38 42 */ 39 43 function bp_setup_components() { … … 49 53 /** 50 54 * Fire the 'bp_setup_canonical_stack' action, where plugins should set up their canonical URL. 55 * 56 * @since 2.1.0 51 57 */ 52 58 function bp_setup_canonical_stack() { … … 92 98 /** 93 99 * Fire the 'bp_setup_globals' action, where plugins should initialize global settings. 100 * 101 * @since 1.2.0 94 102 */ 95 103 function bp_setup_globals() { … … 105 113 /** 106 114 * Fire the 'bp_setup_nav' action, where plugins should register their navigation items. 115 * 116 * @since 1.2.0 107 117 */ 108 118 function bp_setup_nav() { … … 118 128 /** 119 129 * Fire the 'bp_setup_admin_bar' action, where plugins should add items to the WP admin bar. 130 * 131 * @since 1.5.0 120 132 */ 121 133 function bp_setup_admin_bar() { … … 135 147 /** 136 148 * Fire the 'bp_setup_title' action, where plugins should modify the page title. 149 * 150 * @since 1.5.0 137 151 */ 138 152 function bp_setup_title() { … … 148 162 /** 149 163 * Fire the 'bp_register_widgets' action, where plugins should register widgets. 164 * 165 * @since 1.2.0 150 166 */ 151 167 function bp_setup_widgets() { … … 193 209 * 194 210 * We white-list the WordPress customizer which purposely loads the user early. 211 * 212 * @since 1.7.0 195 213 * 196 214 * @link https://buddypress.trac.wordpress.org/ticket/6046 … … 218 236 /** 219 237 * Fire the 'bp_init' action, BuddyPress's main initialization hook. 238 * 239 * @since 1.2.5 220 240 */ 221 241 function bp_init() { … … 253 273 * 254 274 * Attached to 'plugins_loaded'. 275 * 276 * @since 1.2.0 255 277 */ 256 278 function bp_loaded() { … … 268 290 * 269 291 * Attached to 'wp'. 292 * 293 * @since 1.6.0 270 294 */ 271 295 function bp_ready() { … … 284 308 * Attach potential template actions, such as catching form requests or routing 285 309 * custom URLs. 310 * 311 * @since 1.5.0 286 312 */ 287 313 function bp_actions() { … … 300 326 * Runs just after 'bp_actions'. Use this hook to attach your template 301 327 * loaders. 328 * 329 * @since 1.5.0 302 330 */ 303 331 function bp_screens() { … … 317 345 * 318 346 * Hooked to 'widgets_init'. 347 * 348 * @since 1.6.0 319 349 */ 320 350 function bp_widgets_init() { … … 334 364 * 335 365 * Hooked to 'wp_head'. 366 * 367 * @since 1.6.0 336 368 */ 337 369 function bp_head() { 370 371 /** 372 * Fires inside the 'bp_head' function, which runs on 'wp_head'. 373 * 374 * @since 1.6.0 375 */ 338 376 do_action ( 'bp_head' ); 339 377 } -
trunk/src/bp-core/bp-core-filters.php
r10479 r10497 80 80 * Prevent specific pages (eg 'Activate') from showing on page listings. 81 81 * 82 * @since 1.5.0 83 * 82 84 * @uses bp_is_active() checks if a BuddyPress component is active. 83 85 * … … 243 245 244 246 /** 247 * Set "From" name in outgoing email to the site name. 248 * 249 * @since 1.0.0 250 * 251 * @uses bp_get_option() fetches the value for a meta_key in the wp_X_options table. 252 * 253 * @return string The blog name for the root blog. 254 */ 255 function bp_core_email_from_name_filter() { 256 257 /** 258 * Filters the "From" name in outgoing email to the site name. 259 * 260 * @since 1.2.0 261 * 262 * @param string $value Value to set the "From" name to. 263 */ 264 return apply_filters( 'bp_core_email_from_name_filter', bp_get_option( 'blogname', 'WordPress' ) ); 265 } 266 add_filter( 'wp_mail_from_name', 'bp_core_email_from_name_filter' ); 267 268 /** 245 269 * Filter the blog post comments array and insert BuddyPress URLs for users. 270 * 271 * @since 1.2.0 246 272 * 247 273 * @param array $comments The array of comments supplied to the comments template. … … 281 307 /** 282 308 * When a user logs in, redirect him in a logical way. 309 * 310 * @since 1.2.0 283 311 * 284 312 * @uses apply_filters() Filter 'bp_core_login_redirect' to modify where users … … 352 380 * This filter will not fire when a user is registered by the site admin. 353 381 * 382 * @since 1.2.1 383 * 354 384 * @param string $welcome_email Complete email passed through WordPress. 355 385 * @return string Filtered $welcome_email with the password replaced … … 385 415 * 386 416 * This filter will not fire when a user is registered by the site admin. 417 * 418 * @since 1.2.1 387 419 * 388 420 * @param string $welcome_email Complete email passed through WordPress. … … 413 445 * This function filter's WP's 'wpmu_signup_blog_notification', and replaces 414 446 * WP's default welcome email with a BuddyPress-specific message. 447 * 448 * @since 1.0.0 449 * 450 * @see wpmu_signup_blog_notification() for a description of parameters. 415 451 * 416 452 * @param string $domain The new blog domain. … … 444 480 * Notify new users of a successful registration (without blog). 445 481 * 482 * @since 1.0.0 483 * 446 484 * @see wpmu_signup_user_notification() for a full description of params. 447 485 * … … 510 548 global $paged, $page, $_wp_theme_features; 511 549 512 // Get the BuddyPress title parts 550 // Get the BuddyPress title parts. 513 551 $bp_title_parts = bp_get_title_parts( $seplocation ); 514 552 515 // If not set, simply return the original title 553 // If not set, simply return the original title. 516 554 if ( ! $bp_title_parts ) { 517 555 return $title; … … 529 567 $title_tag_compatibility = (bool) ( ! empty( $_wp_theme_features['title-tag'] ) || strstr( $title, $blogname ) ); 530 568 531 // Append the site title to title parts if theme supports title tag 569 // Append the site title to title parts if theme supports title tag. 532 570 if ( true === $title_tag_compatibility ) { 533 571 $bp_title_parts['site'] = $blogname; … … 538 576 } 539 577 540 // Pad the separator with 1 space on each side 578 // Pad the separator with 1 space on each side. 541 579 $prefix = str_pad( $sep, strlen( $sep ) + 2, ' ', STR_PAD_BOTH ); 542 580 543 // Join the parts together 581 // Join the parts together. 544 582 $new_title = join( $prefix, array_filter( $bp_title_parts ) ); 545 583 546 // Append the prefix for pre `title-tag` compatibility 584 // Append the prefix for pre `title-tag` compatibility. 547 585 if ( false === $title_tag_compatibility ) { 548 586 $new_title = $new_title . $prefix; … … 571 609 * @since 2.4.3 572 610 * 573 * @param array $title The WordPress document title parts 611 * @param array $title The WordPress document title parts. 574 612 * @return array the unchanged title parts or the BuddyPress ones 575 613 */ 576 614 function bp_modify_document_title_parts( $title = array() ) { 577 // Get the BuddyPress title parts 615 // Get the BuddyPress title parts. 578 616 $bp_title_parts = bp_get_title_parts(); 579 617 580 // If not set, simply return the original title 618 // If not set, simply return the original title. 581 619 if ( ! $bp_title_parts ) { 582 620 return $title; 583 621 } 584 622 585 // Get the separator used by wp_get_document_title() 623 // Get the separator used by wp_get_document_title(). 586 624 $sep = apply_filters( 'document_title_separator', '-' ); 587 625 -
trunk/src/bp-core/bp-core-functions.php
r10491 r10497 83 83 * 84 84 * The filter is intended primarily for use in multinetwork installations. 85 * 86 * @since 1.2.6 85 87 * 86 88 * @global object $wpdb WordPress database object. … … 171 173 * Format numbers the BuddyPress way. 172 174 * 175 * @since 1.2.0 176 * 173 177 * @param int $number The number to be formatted. 174 178 * @param bool $decimals Whether to use decimals. See {@link number_format_i18n()}. … … 251 255 * are applied. 252 256 * 253 * @since r7704257 * @since 2.0.0 254 258 * 255 259 * @param string|array $args Value to merge with $defaults. … … 777 781 * with the new method. 778 782 * 783 * @since 1.0.0 784 * 779 785 * @param string $slug The slug of the component being added to the root list. 780 786 */ … … 816 822 /** 817 823 * Create WordPress pages to be used as BP component directories. 824 * 825 * @since 1.5.0 818 826 */ 819 827 function bp_core_create_root_component_page() { … … 842 850 * 843 851 * For example, it would stop someone creating a blog with the slug "groups". 852 * 853 * @since 1.0.0 844 854 * 845 855 * @todo Deprecate? … … 918 928 * Eg: http://example.com OR https://example.com 919 929 * 930 * @since 1.0.0 931 * 920 932 * @uses get_blog_option() WordPress function to fetch blog meta. 921 933 * … … 938 950 /** 939 951 * Perform a status-safe wp_redirect() that is compatible with BP's URI parser. 952 * 953 * @since 1.0.0 940 954 * 941 955 * @uses wp_safe_redirect() … … 988 1002 /** 989 1003 * Get the path of the current site. 1004 * 1005 * @since 1.0.0 990 1006 * 991 1007 * @global object $current_site … … 1065 1081 * an interval of 3 minutes will be represented by "3 minutes ago", as will an 1066 1082 * interval of 3 minutes 59 seconds. 1083 * 1084 * @since 1.0.0 1067 1085 * 1068 1086 * @uses apply_filters() Filter 'bp_core_time_since_pre' to bypass BP's calculations. … … 1265 1283 * Add a feedback (error/success) message to the WP cookie so it can be displayed after the page reloads. 1266 1284 * 1285 * @since 1.0.0 1286 * 1267 1287 * @param string $message Feedback message to be displayed. 1268 1288 * @param string $type Message type. 'updated', 'success', 'error', 'warning'. … … 1301 1321 * so that the message is not shown to the user multiple times. 1302 1322 * 1323 * @since 1.1.0 1324 * 1303 1325 * @uses setcookie() Sets a cookie value for the user. 1304 1326 */ … … 1333 1355 * The hook action 'template_notices' is used to call this function, it is not 1334 1356 * called directly. 1357 * 1358 * @since 1.1.0 1335 1359 */ 1336 1360 function bp_core_render_message() { … … 1381 1405 * site. 1382 1406 * 1407 * @since 1.0.0 1408 * 1383 1409 * @uses bp_update_user_meta() BP function to update user metadata in the 1384 1410 * usermeta table. … … 1437 1463 * Format last activity string based on time since date given. 1438 1464 * 1465 * @since 1.0.0 1466 * 1439 1467 * @uses bp_core_time_since() This function will return an English 1440 1468 * representation of the time elapsed. … … 1757 1785 * add_action( bp_core_admin_hook(), 'myplugin_dashboard_panel_setup' ); 1758 1786 * 1787 * @since 1.5.0 1788 * 1759 1789 * @return string $hook The proper hook ('network_admin_menu' or 'admin_menu'). 1760 1790 */ … … 1928 1958 * Set the "is_directory" global. 1929 1959 * 1960 * @since 1.5.0 1961 * 1930 1962 * @param bool $is_directory Optional. Default: false. 1931 1963 * @param string $component Optional. Component name. Default: the current … … 1952 1984 * Set the "is_item_admin" global. 1953 1985 * 1986 * @since 1.5.0 1987 * 1954 1988 * @param bool $is_item_admin Optional. Default: false. 1955 1989 * @param string $component Optional. Component name. Default: the current … … 1975 2009 /** 1976 2010 * Set the "is_item_mod" global. 2011 * 2012 * @since 1.5.0 1977 2013 * 1978 2014 * @param bool $is_item_mod Optional. Default: false. … … 2139 2175 * Load the buddypress translation file for current language. 2140 2176 * 2177 * @since 1.0.2 2178 * 2141 2179 * @see load_textdomain() for a description of return values. 2142 2180 * … … 2181 2219 /** 2182 2220 * A JavaScript-free implementation of the search functions in BuddyPress. 2221 * 2222 * @since 1.0.1 2183 2223 * 2184 2224 * @param string $slug The slug to redirect to for searching. … … 2255 2295 /** 2256 2296 * Print the generation time in the footer of the site. 2297 * 2298 * @since 1.0.0 2257 2299 */ 2258 2300 function bp_core_print_generation_time() { … … 2618 2660 * @since 2.5.0 2619 2661 * 2620 * @param string $ post_type Email post type name.2662 * @param string $value Email post type name. 2621 2663 */ 2622 2664 return apply_filters( 'bp_get_email_post_type', buddypress()->email_post_type ); … … 2637 2679 * @since 2.5.0 2638 2680 * 2639 * @param string[] $labelsAssociative array (name => label).2681 * @param array $value Associative array (name => label). 2640 2682 */ 2641 2683 return apply_filters( 'bp_get_email_post_type_labels', array( … … 2672 2714 * @since 2.5.0 2673 2715 * 2674 * @param string[] $featuresSupported features.2716 * @param array $value Supported features. 2675 2717 */ 2676 2718 return apply_filters( 'bp_get_email_post_type_supports', array( … … 2708 2750 * @since 2.5.0 2709 2751 * 2710 * @param string $ taxonomyEmail type taxonomy name.2752 * @param string $value Email type taxonomy name. 2711 2753 */ 2712 2754 return apply_filters( 'bp_get_email_tax_type', buddypress()->email_taxonomy_type ); … … 2718 2760 * @since 2.5.0 2719 2761 * 2720 * @return string[]2762 * @return array 2721 2763 */ 2722 2764 function bp_get_email_tax_type_labels() { … … 2727 2769 * @since 2.5.0 2728 2770 * 2729 * @param string[] $labelsAssociative array (name => label).2771 * @param array $value Associative array (name => label). 2730 2772 */ 2731 2773 return apply_filters( 'bp_get_email_tax_type_labels', array( … … 2813 2855 * @param string $email_type Unique identifier for a particular type of email. 2814 2856 * @param array $args Arguments used with get_posts() to fetch a post object. 2815 * @param WP_Post []All posts retrieved by get_posts( $args ). May only contain $post.2857 * @param WP_Post $post All posts retrieved by get_posts( $args ). May only contain $post. 2816 2858 */ 2817 2859 $post = apply_filters( 'bp_get_email_post', $post[0], $email_type, $args, $post ); … … 2832 2874 * 2833 2875 * @param BP_Email $email An object representing a single email, ready for mailing. 2834 * @param WP_Post $post Post object containing the contents of the email.2835 2876 * @param string $email_type Unique identifier for a particular type of email. 2836 2877 * @param array $args Arguments used with get_posts() to fetch a post object. 2837 * @param WP_Post []All posts retrieved by get_posts( $args ). May only contain $post.2878 * @param WP_Post $post All posts retrieved by get_posts( $args ). May only contain $post. 2838 2879 */ 2839 2880 $retval = apply_filters( 'bp_get_email', $email, $email_type, $args, $post ); … … 2855 2896 * @since 2.5.0 2856 2897 * 2857 * @param string $email_type Type of email being sent.2858 * @param string|array|int|WP_User $to Either a email address, user ID, WP_User object,2859 * or an array containing any combination of the above.2860 * @param array $args {2898 * @param string $email_type Type of email being sent. 2899 * @param string|array|int|WP_User $to Either a email address, user ID, WP_User object, 2900 * or an array containg the address and name. 2901 * @param array $args { 2861 2902 * Optional. Array of extra. parameters. 2862 2903 * … … 2877 2918 } 2878 2919 2879 // wp_mail() is a pluggable function. Has it been re-defined by another plugin?2920 // Since wp_mail() is a pluggable function, has it been re-defined by another plugin? 2880 2921 if ( is_null( $is_default_wpmail ) ) { 2881 2922 try { … … 2944 2985 * @since 2.5.0 2945 2986 * 2946 * @param string $deliver_class The email delivery class name.2947 * @param string $email_typeType of email being sent.2948 * @param string[]|string $toArray or comma-separated list of email addresses to the email to.2949 * @param array $args {2987 * @param string $deliver_class The email delivery class name. 2988 * @param string $email_type Type of email being sent. 2989 * @param array|string $to Array or comma-separated list of email addresses to the email to. 2990 * @param array $args { 2950 2991 * Optional. Array of extra parameters. 2951 2992 * … … 2962 3003 2963 3004 if ( is_wp_error( $status ) ) { 3005 2964 3006 /** 2965 3007 * Fires after BuddyPress has tried - and failed - to send an email. … … 2969 3011 * @param WP_Error $status A WP_Error object describing why the email failed to send. The contents 2970 3012 * will vary based on the email delivery class you are using. 2971 * @param BP_Email $email The email we tried to send.3013 * @param BP_Email $email The email we tried to send. 2972 3014 */ 2973 3015 do_action( 'bp_send_email_failure', $status, $email ); 2974 3016 2975 3017 } else { 3018 2976 3019 /** 2977 3020 * Fires after BuddyPress has succesfully sent an email. … … 2979 3022 * @since 2.5.0 2980 3023 * 2981 * @param bool $status True if the email was sent successfully.2982 * @param BP_Email $email The email sent.3024 * @param bool $status True if the email was sent successfully. 3025 * @param BP_Email $email The email sent. 2983 3026 */ 2984 3027 do_action( 'bp_send_email_success', $status, $email ); … … 3030 3073 * 3031 3074 * @param WP_Post $object Post to get email template for. 3032 * @return string[]3075 * @return array 3033 3076 */ 3034 3077 function bp_email_get_template( WP_Post $object ) { … … 3040 3083 * @since 2.5.0 3041 3084 * 3042 * @param string[] $templates 3085 * @param array $value Array of possible template paths. 3086 * @param WP_Post $object WP_Post object. 3043 3087 */ 3044 3088 return apply_filters( 'bp_email_get_template', array( -
trunk/src/bp-core/bp-core-loader.php
r10485 r10497 15 15 /** 16 16 * Creates the Core component. 17 * 18 * @since 1.5.0 17 19 */ 18 20 class BP_Core extends BP_Component { … … 148 150 /** 149 151 * Include bp-core files. 152 * 153 * @since 1.6.0 150 154 * 151 155 * @see BP_Component::includes() for description of parameters. -
trunk/src/bp-core/bp-core-options.php
r10417 r10497 335 335 * This function is no longer used. 336 336 * 337 * @since 1.2.4 337 338 * @deprecated 1.6.0 338 339 * … … 371 372 * settings are needed at run time. Instead of fetching them all and adding many 372 373 * initial queries to each page load, let's fetch them all in one go. 374 * 375 * @since 1.5.0 373 376 * 374 377 * @todo Use settings API and audit these methods. -
trunk/src/bp-core/bp-core-template-loader.php
r10425 r10497 188 188 * an array of the template locations. 189 189 * 190 * @since 1.7.0 191 * 190 192 * @see bp_register_template_stack() 191 *192 * @since 1.7.0193 193 * 194 194 * @global array $wp_filter Stores all of the filters. -
trunk/src/bp-core/bp-core-template.php
r10487 r10497 24 24 * The function will also analyze the current action for the current component 25 25 * to determine whether or not to highlight a particular sub nav item. 26 * 27 * @since 1.0.0 26 28 * 27 29 * @uses bp_get_user_nav() Renders the navigation for a profile of a currently … … 209 211 /** 210 212 * Output the current avatar upload step. 213 * 214 * @since 1.1.0 211 215 */ 212 216 function bp_avatar_admin_step() { … … 215 219 /** 216 220 * Return the current avatar upload step. 221 * 222 * @since 1.1.0 217 223 * 218 224 * @return string The current avatar upload step. Returns 'upload-image' … … 237 243 /** 238 244 * Output the URL of the avatar to crop. 245 * 246 * @since 1.1.0 239 247 */ 240 248 function bp_avatar_to_crop() { … … 243 251 /** 244 252 * Return the URL of the avatar to crop. 253 * 254 * @since 1.1.0 245 255 * 246 256 * @return string URL of the avatar awaiting cropping. … … 264 274 /** 265 275 * Output the relative file path to the avatar to crop. 276 * 277 * @since 1.1.0 266 278 */ 267 279 function bp_avatar_to_crop_src() { … … 270 282 /** 271 283 * Return the relative file path to the avatar to crop. 284 * 285 * @since 1.1.0 272 286 * 273 287 * @return string Relative file path to the avatar. … … 304 318 /** 305 319 * Output the name of the BP site. Used in RSS headers. 320 * 321 * @since 1.0.0 306 322 */ 307 323 function bp_site_name() { … … 416 432 * do the necessary argument swapping for dynamic phrases. 417 433 * 434 * @since 1.0.0 435 * 418 436 * @param string $youtext The "you" version of the phrase (eg "Your Friends"). 419 437 * @param string $nametext The other-user version of the phrase. Should be in … … 479 497 /** 480 498 * Return the "action" attribute for search forms. 499 * 500 * @since 1.0.0 481 501 * 482 502 * @return string URL action attribute for search forms, eg example.com/search/. … … 707 727 * Create and output a button. 708 728 * 729 * @since 1.2.6 730 * 709 731 * @see bp_get_button() 710 732 * … … 716 738 /** 717 739 * Create and return a button. 740 * 741 * @since 1.2.6 718 742 * 719 743 * @see BP_Button for a description of arguments and return value. … … 752 776 * - `html` If true, HTML tags would be handled correctly. 753 777 * - `filter_shortcodes` If true, shortcodes will be stripped before truncating. 778 * 779 * @since 1.0.0 754 780 * 755 781 * @param string $text String to truncate. … … 963 989 /** 964 990 * Output the total member count for the site. 991 * 992 * @since 1.2.0 965 993 */ 966 994 function bp_total_member_count() { … … 978 1006 * which did not take into account last_activity, and thus often 979 1007 * resulted in higher counts than shown by member directory pagination. 1008 * 1009 * @since 1.2.0 980 1010 * 981 1011 * @return int Member count. … … 1008 1038 * Network Admin > Settings. 1009 1039 * 1040 * @since 1.2.0 1041 * 1010 1042 * @return bool True if blog signup is allowed, otherwise false. 1011 1043 */ … … 1026 1058 /** 1027 1059 * Check whether an activation has just been completed. 1060 * 1061 * @since 1.1.0 1028 1062 * 1029 1063 * @return bool True if the activation_complete global flag has been set, … … 1045 1079 * activation. This filter exists so that customizations that omit activation 1046 1080 * can remove certain notification text from the registration screen. 1081 * 1082 * @since 1.2.0 1047 1083 * 1048 1084 * @return bool True by default. … … 1116 1152 * WordPress theme without coping the functions from functions.php. 1117 1153 * 1154 * @since 1.2.0 1155 * 1118 1156 * @param string|bool $object Current template component. 1119 1157 * @return string The AJAX querystring. … … 1143 1181 /** 1144 1182 * Return the name of the current component. 1183 * 1184 * @since 1.0.0 1145 1185 * 1146 1186 * @return string Component name. … … 1165 1205 * Return the name of the current action. 1166 1206 * 1207 * @since 1.0.0 1208 * 1167 1209 * @return string Action name. 1168 1210 */ … … 1186 1228 * Return the name of the current item. 1187 1229 * 1230 * @since 1.1.0 1231 * 1188 1232 * @return string|bool 1189 1233 */ … … 1207 1251 * Return the value of $bp->action_variables. 1208 1252 * 1253 * @since 1.0.0 1254 * 1209 1255 * @return array|bool $action_variables The action variables array, or false 1210 1256 * if the array is empty. … … 1254 1300 /** 1255 1301 * Output the "root domain", the URL of the BP root blog. 1302 * 1303 * @since 1.1.0 1256 1304 */ 1257 1305 function bp_root_domain() { … … 1260 1308 /** 1261 1309 * Return the "root domain", the URL of the BP root blog. 1310 * 1311 * @since 1.1.0 1262 1312 * 1263 1313 * @return string URL of the BP root blog. … … 1394 1444 } 1395 1445 1446 /** 1447 * Returns whether or not a user has access. 1448 * 1449 * @since 1.2.4 1450 * 1451 * @return bool 1452 */ 1396 1453 function bp_user_has_access() { 1397 1454 $has_access = bp_current_user_can( 'bp_moderate' ) || bp_is_my_profile(); … … 1439 1496 * Get the ID of the currently displayed user. 1440 1497 * 1498 * @since 1.0.0 1499 * 1441 1500 * @uses apply_filters() Filter 'bp_displayed_user_id' to change this value. 1442 1501 * … … 1461 1520 /** 1462 1521 * Get the ID of the currently logged-in user. 1522 * 1523 * @since 1.0.0 1463 1524 * 1464 1525 * @uses apply_filters() Filter 'bp_loggedin_user_id' to change this value. … … 1642 1703 * Check against the current_item. 1643 1704 * 1705 * @since 1.5.0 1706 * 1644 1707 * @param string $item The item being checked. 1645 1708 * @return bool True if $item is the current item. … … 1661 1724 /** 1662 1725 * Are we looking at a single item? (group, user, etc). 1726 * 1727 * @since 1.1.0 1663 1728 * 1664 1729 * @return bool True if looking at a single item, otherwise false. … … 1685 1750 * Is the logged-in user an admin for the current item? 1686 1751 * 1752 * @since 1.5.0 1753 * 1687 1754 * @return bool True if the current user is an admin for the current item, 1688 1755 * otherwise false. … … 1709 1776 * Is the logged-in user a mod for the current item? 1710 1777 * 1778 * @since 1.5.0 1779 * 1711 1780 * @return bool True if the current user is a mod for the current item, 1712 1781 * otherwise false. … … 1733 1802 * Is this a component directory page? 1734 1803 * 1804 * @since 1.0.0 1805 * 1735 1806 * @return bool True if the current page is a component directory, otherwise false. 1736 1807 */ … … 1761 1832 * This function is on the chopping block. It's currently only used by a few 1762 1833 * already deprecated functions. 1834 * 1835 * @since 1.5.0 1763 1836 * 1764 1837 * @param string $component_name Component name to check. … … 1848 1921 * You can tell if a page is displaying BP content by whether the 1849 1922 * current_component has been defined. 1923 * 1924 * @since 1.0.0 1850 1925 * 1851 1926 * @return bool True if it's a non-BP page, false otherwise. … … 1962 2037 * Check whether the current page is part of the Members component. 1963 2038 * 2039 * @since 1.5.0 2040 * 1964 2041 * @return bool True if the current page is part of the Members component. 1965 2042 */ … … 1971 2048 * Check whether the current page is part of the Profile component. 1972 2049 * 2050 * @since 1.1.0 2051 * 1973 2052 * @return bool True if the current page is part of the Profile component. 1974 2053 */ … … 1980 2059 * Check whether the current page is part of the Activity component. 1981 2060 * 2061 * @since 1.1.0 2062 * 1982 2063 * @return bool True if the current page is part of the Activity component. 1983 2064 */ … … 1989 2070 * Check whether the current page is part of the Blogs component. 1990 2071 * 2072 * @since 1.1.0 2073 * 1991 2074 * @return bool True if the current page is part of the Blogs component. 1992 2075 */ … … 1998 2081 * Check whether the current page is part of the Messages component. 1999 2082 * 2083 * @since 1.1.0 2084 * 2000 2085 * @return bool True if the current page is part of the Messages component. 2001 2086 */ … … 2007 2092 * Check whether the current page is part of the Friends component. 2008 2093 * 2094 * @since 1.1.0 2095 * 2009 2096 * @return bool True if the current page is part of the Friends component. 2010 2097 */ … … 2016 2103 * Check whether the current page is part of the Groups component. 2017 2104 * 2105 * @since 1.1.0 2106 * 2018 2107 * @return bool True if the current page is part of the Groups component. 2019 2108 */ … … 2025 2114 * Check whether the current page is part of the Forums component. 2026 2115 * 2116 * @since 1.5.0 2117 * 2027 2118 * @return bool True if the current page is part of the Forums component. 2028 2119 */ … … 2044 2135 /** 2045 2136 * Check whether the current page is part of the Settings component. 2137 * 2138 * @since 1.1.0 2046 2139 * 2047 2140 * @return bool True if the current page is part of the Settings component. … … 2060 2153 * BuddyPress core, it will return true. 2061 2154 * 2155 * @since 1.7.0 2156 * 2062 2157 * @return bool True if the current component is active and is one of BP's 2063 2158 * packaged components. … … 2096 2191 * Is the current page a single activity item permalink? 2097 2192 * 2193 * @since 1.5.0 2194 * 2098 2195 * @return bool True if the current page is a single activity item permalink. 2099 2196 */ … … 2124 2221 * Will return true for any subpage of the logged-in user's profile, eg 2125 2222 * http://example.com/members/joe/friends/. 2223 * 2224 * @since 1.2.0 2126 2225 * 2127 2226 * @return bool True if the current page is part of the profile of the logged-in user. … … 2149 2248 * Will return true anytime there is a displayed user. 2150 2249 * 2250 * @since 1.5.0 2251 * 2151 2252 * @return bool True if the current page is a user page. 2152 2253 */ … … 2160 2261 * Eg http://example.com/members/joe/activity/ (or any subpages thereof). 2161 2262 * 2263 * @since 1.1.0 2264 * 2162 2265 * @return bool True if the current page is a user's activity stream page. 2163 2266 */ … … 2171 2274 * Eg http://example.com/members/joe/friends/ 2172 2275 * 2276 * @since 1.1.0 2277 * 2173 2278 * @return bool True if the current page is a user's Friends activity stream. 2174 2279 */ … … 2196 2301 * 2197 2302 * Eg http://example.com/members/joe/groups/ 2303 * 2304 * @since 1.5.0 2198 2305 * 2199 2306 * @return bool True if the current page is a user's Groups activity stream. … … 2221 2328 * Eg http://example.com/members/joe/profile/ (or a subpage thereof). 2222 2329 * 2330 * @since 1.1.0 2331 * 2223 2332 * @return bool True if the current page is part of a user's extended profile. 2224 2333 */ … … 2232 2341 * Eg http://example.com/members/joe/profile/edit/ (or a subpage thereof). 2233 2342 * 2343 * @since 1.5.0 2344 * 2234 2345 * @return bool True if the current page is a user's profile edit page. 2235 2346 */ … … 2238 2349 } 2239 2350 2351 /** 2352 * Is the current page part of a user's profile avatar editing section? 2353 * 2354 * Eg http://example.com/members/joe/profile/change-avatar/ (or a subpage thereof). 2355 * 2356 * @since 1.5.0 2357 * 2358 * @return bool True if the current page is the user's avatar edit page. 2359 */ 2240 2360 function bp_is_user_change_avatar() { 2241 2361 return (bool) ( bp_is_profile_component() && bp_is_current_action( 'change-avatar' ) ); … … 2260 2380 * Eg http://example.com/members/joe/forums/ (or a subpage thereof). 2261 2381 * 2382 * @since 1.5.0 2383 * 2262 2384 * @return bool True if the current page is a user's forums page. 2263 2385 */ … … 2306 2428 * Eg http://example.com/members/joe/groups/ (or a subpage thereof). 2307 2429 * 2430 * @since 1.1.0 2431 * 2308 2432 * @return bool True if the current page is a user's Groups page. 2309 2433 */ … … 2317 2441 * Eg http://example.com/members/joe/blogs/ (or a subpage thereof). 2318 2442 * 2443 * @since 1.1.0 2444 * 2319 2445 * @return bool True if the current page is a user's Blogs page. 2320 2446 */ … … 2328 2454 * Eg http://example.com/members/joe/blogs/recent-posts/. 2329 2455 * 2456 * @since 1.1.0 2457 * 2330 2458 * @return bool True if the current page is a user's Recent Blog Posts page. 2331 2459 */ … … 2339 2467 * Eg http://example.com/members/joe/blogs/recent-comments/. 2340 2468 * 2469 * @since 1.1.0 2470 * 2341 2471 * @return bool True if the current page is a user's Recent Blog Comments page. 2342 2472 */ … … 2350 2480 * Eg http://example.com/members/joe/blogs/friends/ (or a subpage thereof). 2351 2481 * 2482 * @since 1.1.0 2483 * 2352 2484 * @return bool True if the current page is a user's Friends page. 2353 2485 */ … … 2361 2493 * Eg http://example.com/members/joe/friends/requests/. 2362 2494 * 2495 * @since 1.5.0 2496 * 2363 2497 * @return bool True if the current page is a user's Friends Requests page. 2364 2498 */ … … 2384 2518 * 2385 2519 * Eg http://example.com/members/joe/settings/ (or a subpage thereof). 2520 * 2521 * @since 1.5.0 2386 2522 * 2387 2523 * @return bool True if the current page is a user's Settings page. … … 2465 2601 * Will return true for any subpage of a single group. 2466 2602 * 2603 * @since 1.2.0 2604 * 2467 2605 * @return bool True if the current page is part of a single group. 2468 2606 */ … … 2482 2620 * URL will vary depending on which group tab is set to be the "home". By 2483 2621 * default, it's the group's recent activity. 2622 * 2623 * @since 1.1.0 2484 2624 * 2485 2625 * @return bool True if the current page is a single group's home page. … … 2496 2636 * Is the current page part of the group creation process? 2497 2637 * 2638 * @since 1.1.0 2639 * 2498 2640 * @return bool True if the current page is part of the group creation process. 2499 2641 */ … … 2507 2649 * Eg http://example.com/groups/mygroup/admin/settings/. 2508 2650 * 2651 * @since 1.1.0 2652 * 2509 2653 * @return bool True if the current page is part of a single group's admin. 2510 2654 */ … … 2517 2661 * 2518 2662 * Only applies to legacy bbPress forums. 2663 * 2664 * @since 1.1.0 2519 2665 * 2520 2666 * @return bool True if the current page is a group forum page. … … 2540 2686 * Is the current page a group's activity page? 2541 2687 * 2688 * @since 1.2.1 2689 * 2542 2690 * @return True if the current page is a group's activity page. 2543 2691 */ … … 2561 2709 * Only applies to legacy bbPress (1.x) forums. 2562 2710 * 2711 * @since 1.1.0 2712 * 2563 2713 * @return bool True if the current page is part of a group forum topic. 2564 2714 */ … … 2572 2722 * Only applies to legacy bbPress (1.x) forums. 2573 2723 * 2724 * @since 1.2.0 2725 * 2574 2726 * @return bool True if the current page is part of a group forum topic edit page. 2575 2727 */ … … 2583 2735 * Eg http://example.com/groups/mygroup/members/. 2584 2736 * 2737 * @since 1.1.0 2738 * 2585 2739 * @return bool True if the current page is part of a group's Members page. 2586 2740 */ … … 2604 2758 * Eg http://example.com/groups/mygroup/send-invites/. 2605 2759 * 2760 * @since 1.1.0 2761 * 2606 2762 * @return bool True if the current page is a group's Send Invites page. 2607 2763 */ … … 2615 2771 * Eg http://example.com/groups/mygroup/request-membership/. 2616 2772 * 2773 * @since 1.2.0 2774 * 2617 2775 * @return bool True if the current page is a group's Request Membership page. 2618 2776 */ … … 2623 2781 /** 2624 2782 * Is the current page a leave group attempt? 2783 * 2784 * @since 1.1.0 2625 2785 * 2626 2786 * @return bool True if the current page is a Leave Group attempt. … … 2660 2820 * Eg http://example.com/sites/create/. 2661 2821 * 2822 * @since 1.1.0 2823 * 2662 2824 * @return bool True if the current page is the Create a Blog page. 2663 2825 */ … … 2688 2850 * Eg http://example.com/members/joe/messages/ (or a subpage thereof). 2689 2851 * 2852 * @since 1.2.0 2853 * 2690 2854 * @return bool True if the current page is part of a user's Messages pages. 2691 2855 */ … … 2698 2862 * 2699 2863 * Eg http://example.com/members/joe/messages/inbox/. 2864 * 2865 * @since 1.1.0 2700 2866 * 2701 2867 * @return bool True if the current page is a user's Messages Inbox. … … 2714 2880 * Eg http://example.com/members/joe/messages/sentbox/. 2715 2881 * 2882 * @since 1.1.0 2883 * 2716 2884 * @return bool True if the current page is a user's Messages Sentbox. 2717 2885 */ … … 2725 2893 * Eg http://example.com/members/joe/messages/compose/. 2726 2894 * 2895 * @since 1.1.0 2896 * 2727 2897 * @return bool True if the current page is a user's Messages Compose screen. 2728 2898 */ … … 2736 2906 * Eg http://example.com/members/joe/messages/notices/. 2737 2907 * 2908 * @since 1.1.0 2909 * 2738 2910 * @return bool True if the current page is the Notices screen. 2739 2911 */ … … 2744 2916 /** 2745 2917 * Is the current page a single Messages conversation thread? 2918 * 2919 * @since 1.6.0 2746 2920 * 2747 2921 * @return bool True if the current page a single Messages conversation thread? … … 2769 2943 * Eg http://example.com/activate/. 2770 2944 * 2945 * @since 1.1.0 2946 * 2771 2947 * @return bool True if the current page is the Activate page. 2772 2948 */ … … 2780 2956 * Eg http://example.com/register/. 2781 2957 * 2958 * @since 1.1.0 2959 * 2782 2960 * @return bool True if the current page is the Register page. 2783 2961 */ … … 2791 2969 * @since 2.4.3 2792 2970 * 2793 * @param string $seplocation 2971 * @param string $seplocation Location for the separator. 2794 2972 * @return array the title parts 2795 2973 */ … … 2797 2975 $bp = buddypress(); 2798 2976 2799 // Defaults to an empty array 2977 // Defaults to an empty array. 2800 2978 $bp_title_parts = array(); 2801 2979 … … 2926 3104 /** 2927 3105 * Customize the body class, according to the currently displayed BP content. 3106 * 3107 * @since 1.1.0 2928 3108 */ 2929 3109 function bp_the_body_class() { … … 2934 3114 * 2935 3115 * Uses the above is_() functions to output a body class for each scenario. 3116 * 3117 * @since 1.1.0 2936 3118 * 2937 3119 * @param array $wp_classes The body classes coming from WP. -
trunk/src/bp-core/bp-core-theme-compatibility.php
r10417 r10497 53 53 * Template package properties, as passed to the constructor. 54 54 * 55 * @since 1.7.0 55 56 * @var array 56 57 */ -
trunk/src/bp-core/bp-core-update.php
r10474 r10497 43 43 function bp_is_update() { 44 44 45 // Current DB version of this site (per site in a multisite network) 45 // Current DB version of this site (per site in a multisite network). 46 46 $current_db = bp_get_option( '_bp_db_version' ); 47 47 $current_live = bp_get_db_version(); 48 48 49 // Compare versions (cast as int and bool to be safe) 49 // Compare versions (cast as int and bool to be safe). 50 50 $is_update = (bool) ( (int) $current_db < (int) $current_live ); 51 51 52 // Return the product of version comparison 52 // Return the product of version comparison. 53 53 return $is_update; 54 54 } … … 74 74 } 75 75 76 // Bail if not activating 76 // Bail if not activating. 77 77 if ( empty( $action ) || !in_array( $action, array( 'activate', 'activate-selected' ) ) ) { 78 78 return false; 79 79 } 80 80 81 // The plugin(s) being activated 81 // The plugin(s) being activated. 82 82 if ( $action == 'activate' ) { 83 83 $plugins = isset( $_GET['plugin'] ) ? array( $_GET['plugin'] ) : array(); … … 86 86 } 87 87 88 // Set basename if empty 88 // Set basename if empty. 89 89 if ( empty( $basename ) && !empty( $bp->basename ) ) { 90 90 $basename = $bp->basename; 91 91 } 92 92 93 // Bail if no basename 93 // Bail if no basename. 94 94 if ( empty( $basename ) ) { 95 95 return false; … … 120 120 } 121 121 122 // Bail if not deactivating 122 // Bail if not deactivating. 123 123 if ( empty( $action ) || !in_array( $action, array( 'deactivate', 'deactivate-selected' ) ) ) { 124 124 return false; 125 125 } 126 126 127 // The plugin(s) being deactivated 127 // The plugin(s) being deactivated. 128 128 if ( 'deactivate' == $action ) { 129 129 $plugins = isset( $_GET['plugin'] ) ? array( $_GET['plugin'] ) : array(); … … 132 132 } 133 133 134 // Set basename if empty 134 // Set basename if empty. 135 135 if ( empty( $basename ) && !empty( $bp->basename ) ) { 136 136 $basename = $bp->basename; 137 137 } 138 138 139 // Bail if no basename 139 // Bail if no basename. 140 140 if ( empty( $basename ) ) { 141 141 return false; … … 187 187 function bp_version_updater() { 188 188 189 // Get the raw database version 189 // Get the raw database version. 190 190 $raw_db_version = (int) bp_get_db_version_raw(); 191 191 … … 207 207 require_once( buddypress()->plugin_dir . '/bp-core/admin/bp-core-admin-schema.php' ); 208 208 209 // Install BP schema and activate only Activity and XProfile 209 // Install BP schema and activate only Activity and XProfile. 210 210 if ( bp_is_install() ) { 211 211 212 // Apply schema and set Activity and XProfile components as active 212 // Apply schema and set Activity and XProfile components as active. 213 213 bp_core_install( $default_components ); 214 214 bp_update_option( 'bp-active-components', $default_components ); … … 216 216 bp_core_install_emails(); 217 217 218 // Upgrades 218 // Upgrades. 219 219 } else { 220 220 221 // Run the schema install to update tables 221 // Run the schema install to update tables. 222 222 bp_core_install(); 223 223 … … 269 269 } 270 270 271 /* *All done! *************************************************************/272 273 // Bump the version 271 /* All done! *************************************************************/ 272 273 // Bump the version. 274 274 bp_version_bump(); 275 275 } … … 290 290 // 2.3.0: Change index lengths to account for utf8mb4. 291 291 if ( $raw_db_version < 9695 ) { 292 // table_name => columns.292 // Map table_name => columns. 293 293 $tables = array( 294 294 $bp_prefix . 'bp_activity_meta' => array( 'meta_key' ), … … 321 321 function bp_update_to_1_5() { 322 322 323 // Delete old database version options 323 // Delete old database version options. 324 324 delete_site_option( 'bp-activity-db-version' ); 325 325 delete_site_option( 'bp-blogs-db-version' ); … … 339 339 function bp_update_to_1_6() { 340 340 341 // Delete possible site options 341 // Delete possible site options. 342 342 delete_site_option( 'bp-db-version' ); 343 343 delete_site_option( '_bp_db_version' ); … … 345 345 delete_site_option( '_bp-core-db-version' ); 346 346 347 // Delete possible blog options 347 // Delete possible blog options. 348 348 delete_blog_option( bp_get_root_blog_id(), 'bp-db-version' ); 349 349 delete_blog_option( bp_get_root_blog_id(), 'bp-core-db-version' ); … … 363 363 function bp_update_to_1_9() { 364 364 365 // Setup hardcoded keys 365 // Setup hardcoded keys. 366 366 $active_components_key = 'bp-active-components'; 367 367 $notifications_component_id = 'notifications'; 368 368 369 // Get the active components 369 // Get the active components. 370 370 $active_components = bp_get_option( $active_components_key ); 371 371 372 // Add notifications 372 // Add notifications. 373 373 if ( ! in_array( $notifications_component_id, $active_components ) ) { 374 374 $active_components[ $notifications_component_id ] = 1; 375 375 } 376 376 377 // Update the active components option 377 // Update the active components option. 378 378 bp_update_option( $active_components_key, $active_components ); 379 379 } … … 412 412 function bp_update_to_2_0() { 413 413 414 /* *Install activity tables for 'last_activity' ***************************/414 /* Install activity tables for 'last_activity' ***************************/ 415 415 416 416 bp_core_install_activity_streams(); 417 417 418 /* *Migrate 'last_activity' data ******************************************/418 /* Migrate 'last_activity' data ******************************************/ 419 419 420 420 bp_last_activity_migrate(); 421 421 422 /* *Migrate signups data **************************************************/422 /* Migrate signups data **************************************************/ 423 423 424 424 if ( ! is_multisite() ) { 425 425 426 // Maybe install the signups table 426 // Maybe install the signups table. 427 427 bp_core_maybe_install_signups(); 428 428 429 // Run the migration script 429 // Run the migration script. 430 430 bp_members_migrate_signups(); 431 431 } 432 432 433 /* *Add BP options to the options table ***********************************/433 /* Add BP options to the options table ***********************************/ 434 434 435 435 bp_add_options(); … … 461 461 function bp_update_to_2_2() { 462 462 463 // Also handled by `bp_core_install()` 463 // Also handled by `bp_core_install()`. 464 464 if ( bp_is_active( 'messages' ) ) { 465 465 bp_core_install_private_messaging(); … … 484 484 function bp_update_to_2_3() { 485 485 486 // Also handled by `bp_core_install()` 486 // Also handled by `bp_core_install()`. 487 487 if ( bp_is_active( 'notifications' ) ) { 488 488 bp_core_install_notifications(); … … 508 508 * @global $wpdb 509 509 * @uses buddypress() 510 *511 510 */ 512 511 function bp_migrate_new_member_activity_component() { … … 514 513 $bp = buddypress(); 515 514 516 // Update the component for the new_member type 515 // Update the component for the new_member type. 517 516 $wpdb->update( 518 // Activity table 517 // Activity table. 519 518 $bp->members->table_name_last_activity, 520 519 array( … … 525 524 'type' => 'new_member', 526 525 ), 527 // Data sanitization format 526 // Data sanitization format. 528 527 array( 529 528 '%s', 530 529 ), 531 // WHERE sanitization format 530 // WHERE sanitization format. 532 531 array( 533 532 '%s', … … 563 562 function bp_add_activation_redirect() { 564 563 565 // Bail if activating from network, or bulk 564 // Bail if activating from network, or bulk. 566 565 if ( isset( $_GET['activate-multi'] ) ) { 567 566 return; … … 569 568 570 569 // Record that this is a new installation, so we show the right 571 // welcome message 570 // welcome message. 572 571 if ( bp_is_install() ) { 573 572 set_transient( '_bp_is_new_install', true, 30 ); 574 573 } 575 574 576 // Add the transient to redirect 575 // Add the transient to redirect. 577 576 set_transient( '_bp_activation_redirect', true, 30 ); 578 577 } … … 586 585 * 587 586 * @global WPDB $wpdb 588 *589 * @return bool|null If signups table exists.590 587 */ 591 588 function bp_core_maybe_install_signups() { 592 589 global $wpdb; 593 590 594 // The table to run queries against 591 // The table to run queries against. 595 592 $signups_table = $wpdb->base_prefix . 'signups'; 596 593 597 // Suppress errors because users shouldn't see what happens next 594 // Suppress errors because users shouldn't see what happens next. 598 595 $old_suppress = $wpdb->suppress_errors(); 599 596 600 // Never use bp_core_get_table_prefix() for any global users tables 597 // Never use bp_core_get_table_prefix() for any global users tables. 601 598 $table_exists = (bool) $wpdb->get_results( "DESCRIBE {$signups_table};" ); 602 599 … … 604 601 if ( true === $table_exists ) { 605 602 606 // Look for the 'signup_id' column 603 // Look for the 'signup_id' column. 607 604 $column_exists = $wpdb->query( "SHOW COLUMNS FROM {$signups_table} LIKE 'signup_id'" ); 608 605 … … 618 615 } 619 616 620 // Restore previous error suppression setting 617 // Restore previous error suppression setting. 621 618 $wpdb->suppress_errors( $old_suppress ); 622 619 } … … 638 635 delete_site_transient( 'theme_roots' ); 639 636 640 // Add options 637 // Add options. 641 638 bp_add_options(); 642 639 -
trunk/src/bp-core/bp-core-widgets.php
r10417 r10497 30 30 /** 31 31 * Constructor method. 32 * 33 * @since 1.9.0 32 34 */ 33 35 public function __construct() { … … 44 46 /** 45 47 * Display the login widget. 48 * 49 * @since 1.9.0 46 50 * 47 51 * @see WP_Widget::widget() for description of parameters. … … 155 159 * Update the login widget options. 156 160 * 161 * @since 1.9.0 162 * 157 163 * @param array $new_instance The new instance options. 158 164 * @param array $old_instance The old instance options. … … 168 174 /** 169 175 * Output the login widget options form. 176 * 177 * @since 1.9.0 170 178 * 171 179 * @param array $instance Settings for this widget. -
trunk/src/bp-core/bp-core-wpabstraction.php
r10417 r10497 32 32 } 33 33 34 /* *34 /* 35 35 * Only add MS-specific abstraction functions if WordPress is not in multisite mode. 36 36 */ … … 45 45 /** 46 46 * Retrieve blog option. 47 * 48 * @since 1.0.0 47 49 * 48 50 * @see get_blog_option() … … 62 64 63 65 /** 64 * Add blog option 66 * Add blog option. 67 * 68 * @since 1.2.0 65 69 * 66 70 * @see add_blog_option() … … 82 86 * Update blog option. 83 87 * 88 * @since 1.2.0 89 * 84 90 * @see update_blog_option() 85 91 * … … 100 106 * Delete blog option. 101 107 * 108 * @since 1.5.0 109 * 102 110 * @see delete_blog_option() 103 111 * … … 117 125 * Switch to specified blog. 118 126 * 127 * @since 1.2.0 128 * 119 129 * @see switch_to_blog() 120 130 * … … 134 144 * Restore current blog. 135 145 * 146 * @since 1.2.0 147 * 136 148 * @see restore_current_blog() 137 149 * … … 148 160 * Retrive blogs associated with user. 149 161 * 162 * @since 1.2.0 163 * 150 164 * @see get_blogs_of_user() 151 165 * … … 161 175 162 176 if ( !function_exists( 'update_blog_status' ) ) { 177 163 178 /** 164 179 * Whether or not to update blog status. 180 * 181 * @since 1.2.0 165 182 * 166 183 * @see update_blog_status() … … 179 196 180 197 if ( !function_exists( 'is_subdomain_install' ) ) { 198 181 199 /** 182 200 * Whether or not if subdomain install. 201 * 202 * @since 1.2.5.1 183 203 * 184 204 * @see is_subdomain_install() … … 220 240 */ 221 241 if ( !function_exists( 'mb_strlen' ) ) { 242 222 243 /** 223 244 * Fallback implementation of mb_strlen(), hardcoded to UTF-8. … … 245 266 246 267 if ( !function_exists( 'mb_strpos' ) ) { 268 247 269 /** 248 270 * Fallback implementation of mb_strpos(), hardcoded to UTF-8. … … 269 291 270 292 if ( !function_exists( 'mb_strrpos' ) ) { 293 271 294 /** 272 295 * Fallback implementation of mb_strrpos(), hardcoded to UTF-8.
Note: See TracChangeset
for help on using the changeset viewer.