Changeset 30630 for trunk/src/wp-admin/includes/ms.php
- Timestamp:
- 11/30/2014 05:05:36 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ms.php
r30404 r30630 45 45 46 46 /** 47 * Delete a blog 48 * 49 * @since 3.0.0 50 * 51 * @param int $blog_id Blog ID 52 * @param bool $drop True if blog's table should be dropped. Default is false. 53 * @return void 47 * Delete a blog. 48 * 49 * @since 3.0.0 50 * 51 * @param int $blog_id Blog ID. 52 * @param bool $drop True if blog's table should be dropped. Default is false. 54 53 */ 55 54 function wpmu_delete_blog( $blog_id, $drop = false ) { … … 170 169 } 171 170 172 // @todo Merge with wp_delete_user() ? 171 /** 172 * Delete a user from the network and remove from all sites. 173 * 174 * @since 3.0.0 175 * 176 * @todo Merge with wp_delete_user() ? 177 * 178 * @param int $id The user ID. 179 * @return bool True if the user was deleted, otherwise false. 180 */ 173 181 function wpmu_delete_user( $id ) { 174 182 global $wpdb; … … 226 234 } 227 235 236 /** 237 * Sends an email when a site administrator email address is changed. 238 * 239 * @since 3.0.0 240 * 241 * @param string $old_value The old email address. Not currently used. 242 * @param string $value The new email address. 243 */ 228 244 function update_option_new_admin_email( $old_value, $value ) { 229 245 if ( $value == get_option( 'admin_email' ) || !is_email( $value ) ) … … 279 295 add_action( 'add_option_new_admin_email', 'update_option_new_admin_email', 10, 2 ); 280 296 297 /** 298 * Sends an email when an email address change is requested. 299 * 300 * @since 3.0.0 301 * 302 * @global object $errors WP_Error object. 303 * @global object $wpdb WordPress database object. 304 */ 281 305 function send_confirmation_on_profile_email() { 282 306 global $errors, $wpdb; … … 349 373 add_action( 'personal_options_update', 'send_confirmation_on_profile_email' ); 350 374 375 /** 376 * Adds an admin notice alerting the user to check for confirmation email 377 * after email address change. 378 * 379 * @since 3.0.0 380 */ 351 381 function new_user_email_admin_notice() { 352 382 if ( strpos( $_SERVER['PHP_SELF'], 'profile.php' ) && isset( $_GET['updated'] ) && $email = get_option( get_current_user_id() . '_new_email' ) ) … … 361 391 * 362 392 * @param bool $echo Optional. If $echo is set and the quota is exceeded, a warning message is echoed. Default is true. 363 * @return int393 * @return bool True if user is over upload space quota, otherwise false. 364 394 */ 365 395 function upload_is_user_over_quota( $echo = true ) { … … 423 453 } 424 454 425 // Edit blog upload space setting on Edit Blog page 455 /** 456 * Displays the edit blog upload space setting form on the Edit Blog screen. 457 * 458 * @since 3.0.0 459 * 460 * @param int $id The ID of the blog to display the setting for. 461 */ 426 462 function upload_space_setting( $id ) { 427 463 switch_to_blog( $id ); … … 441 477 add_action( 'wpmueditblogaction', 'upload_space_setting' ); 442 478 479 /** 480 * Update the status of a user in the database. 481 * 482 * Used in core to mark a user as spam or "ham" (not spam) in Multisite. 483 * 484 * @since 3.0.0 485 * 486 * @param int $id The user ID. 487 * @param string $pref The column in the wp_users table to update the user's status 488 * in (presumably user_status, spam, or deleted). 489 * @param int $value The new status for the user. 490 * @param null $deprecated Deprecated as of 3.0.2 and should not be used. 491 * @return int The initially passed $value. 492 */ 443 493 function update_user_status( $id, $pref, $value, $deprecated = null ) { 444 494 global $wpdb; … … 477 527 } 478 528 529 /** 530 * Cleans the user cache for a specific user. 531 * 532 * @since 3.0.0 533 * 534 * @param int $id The user ID. 535 * @return bool|int The ID of the refreshed user or false if the user does not exist. 536 */ 479 537 function refresh_user_details( $id ) { 480 538 $id = (int) $id; … … 488 546 } 489 547 548 /** 549 * Returns the language for a language code. 550 * 551 * @since 3.0.0 552 * 553 * @param string $code Optional. The two-letter language code. Default empty. 554 * @return string The language corresponding to $code if it exists. If it does not exist, 555 * then the first two letters of $code is returned. 556 */ 490 557 function format_code_lang( $code = '' ) { 491 558 $code = strtolower( substr( $code, 0, 2 ) ); … … 515 582 } 516 583 584 /** 585 * Synchronize category and post tag slugs when global terms are enabled. 586 * 587 * @since 3.0.0 588 * 589 * @param $term The term. 590 * @param $taxonomy The taxonomy for $term. Should be 'category' or 'post_tag', as these are 591 * the only taxonomies which are processed by this function; anything else 592 * will be returned untouched. 593 * @return object|array Returns `$term`, after filtering the 'slug' field with {@see sanitize_title()} 594 * if $taxonomy is 'category' or 'post_tag'. 595 */ 517 596 function sync_category_tag_slugs( $term, $taxonomy ) { 518 597 if ( global_terms_enabled() && ( $taxonomy == 'category' || $taxonomy == 'post_tag' ) ) { … … 527 606 add_filter( 'get_term', 'sync_category_tag_slugs', 10, 2 ); 528 607 608 /** 609 * Displays an access denied message when a user tries to view a site's dashboard they 610 * do not have access to. 611 * 612 * @since 3.2.0 613 * @access private 614 */ 529 615 function _access_denied_splash() { 530 616 if ( ! is_user_logged_in() || is_network_admin() ) … … 561 647 add_action( 'admin_page_access_denied', '_access_denied_splash', 99 ); 562 648 649 /** 650 * Checks if the current user has permissions to import new users. 651 * 652 * @since 3.0.0 653 * 654 * @param string $permission A permission to be checked. Currently not used. 655 * @return bool True if the user has proper permissions, false if they do not. 656 */ 563 657 function check_import_new_users( $permission ) { 564 658 if ( !is_super_admin() ) … … 569 663 // See "import_allow_fetch_attachments" and "import_attachment_size_limit" filters too. 570 664 665 /** 666 * Generates and displays a drop-down of available languages. 667 * 668 * @since 3.0.0 669 * 670 * @param array $lang_files Optional. An array of the language files. Default empty array. 671 * @param string $current Optional. The current language code. Default empty. 672 */ 571 673 function mu_dropdown_languages( $lang_files = array(), $current = '' ) { 572 674 $flag = false; … … 596 698 // Order by name 597 699 uksort( $output, 'strnatcasecmp' ); 700 598 701 /** 599 702 * Filter the languages available in the dropdown. … … 606 709 */ 607 710 $output = apply_filters( 'mu_dropdown_languages', $output, $lang_files, $current ); 711 608 712 echo implode( "\n\t", $output ); 609 713 } 610 714 715 /** 716 * Displays an admin notice to upgrade all sites after a core upgrade. 717 * 718 * @since 3.0.0 719 * 720 * @global int $wp_db_version The version number of the database. 721 */ 611 722 function site_admin_notice() { 612 723 global $wp_db_version; … … 619 730 add_action( 'network_admin_notices', 'site_admin_notice' ); 620 731 732 /** 733 * Avoids a collision between a site slug and a permalink slug. 734 * 735 * In a subdirectory install this will make sure that a site and a post do not use the 736 * same subdirectory by checking for a site with the same name as a new post. 737 * 738 * @since 3.0.0 739 * 740 * @param array $data An array of post data. 741 * @param array $postarr An array of posts. Not currently used. 742 * @return array The new array of post data after checking for collisions. 743 */ 621 744 function avoid_blog_page_permalink_collision( $data, $postarr ) { 622 745 if ( is_subdomain_install() ) … … 642 765 add_filter( 'wp_insert_post_data', 'avoid_blog_page_permalink_collision', 10, 2 ); 643 766 767 /** 768 * Handles the display of choosing a user's primary site. 769 * 770 * This displays the user's primary site and allows the user to choose 771 * which site is primary. 772 * 773 * @since 3.0.0 774 */ 644 775 function choose_primary_blog() { 645 776 ?> … … 697 828 * 698 829 * @since 3.0.0 830 * 699 831 * @param int $user_id ID of the user to be granted Super Admin privileges. 700 832 * @return bool True on success, false on failure. This can fail when the user is 701 * already a super admin or when the $super_adminsglobal is defined.833 * already a super admin or when the `$super_admins` global is defined. 702 834 */ 703 835 function grant_super_admin( $user_id ) { … … 741 873 * 742 874 * @since 3.0.0 875 * 743 876 * @param int $user_id ID of the user Super Admin privileges to be revoked from. 744 877 * @return bool True on success, false on failure. This can fail when the user's email 745 * is the network admin email or when the $super_adminsglobal is defined.878 * is the network admin email or when the `$super_admins` global is defined. 746 879 */ 747 880 function revoke_super_admin( $user_id ) { … … 784 917 785 918 /** 786 * Whether or not we can edit this network from this page 787 * 788 * By default editing of network is restricted to the Network Admin for that site_id this allows for this to be overridden 919 * Whether or not we can edit this network from this page. 920 * 921 * By default editing of network is restricted to the Network Admin for that `$site_id` 922 * this allows for this to be overridden. 789 923 * 790 924 * @since 3.1.0 791 * @param integer $site_id The network/site ID to check. 925 * 926 * @param int $site_id The network/site ID to check. 927 * @return bool True if network can be edited, otherwise false. 792 928 */ 793 929 function can_edit_network( $site_id ) { … … 814 950 * 815 951 * @since 3.1.0 952 * 816 953 * @access private 817 954 */
Note: See TracChangeset
for help on using the changeset viewer.