Ticket #32444: 32444.5.diff
File 32444.5.diff, 27.0 KB (added by , 9 years ago) |
---|
-
src/wp-includes/ms-blogs.php
12 12 * Update the last_updated field for the current blog. 13 13 * 14 14 * @since MU 15 * 16 * @global wpdb $wpdb 15 17 */ 16 18 function wpmu_update_blogs_date() { 17 19 global $wpdb; … … 66 68 * 67 69 * @since MU 68 70 * 71 * @global wpdb $wpdb 72 * 69 73 * @param string $slug 70 74 * @return int A blog id 71 75 */ … … 97 101 * 98 102 * @since MU 99 103 * 100 * @param int|string|array $fields A blog ID, a blog slug, or an array of fields to query against. Optional. If not specified the current blog ID is used. 101 * @param bool $get_all Whether to retrieve all details or only the details in the blogs table. Default is true. 104 * @global wpdb $wpdb 105 * 106 * @param int|string|array $fields Optional. A blog ID, a blog slug, or an array of fields to query against. 107 * If not specified the current blog ID is used. 108 * @param bool $get_all Whether to retrieve all details or only the details in the blogs table. 109 * Default is true. 102 110 * @return object|false Blog details on success. False on failure. 103 111 */ 104 112 function get_blog_details( $fields = null, $get_all = true ) { … … 272 280 * 273 281 * @since MU 274 282 * 275 * @param int $blog_id Blog ID 283 * @global wpdb $wpdb 284 * 285 * @param int $blog_id Blog ID 276 286 * @param array $details Array of details keyed by blogs table field names. 277 287 * @return bool True if update succeeds, false otherwise. 278 288 */ … … 444 454 * 445 455 * @since MU 446 456 * 447 * @param int $idA blog ID. Can be null to refer to the current blog.448 * @param string $option Name of option to retrieve. Expected to not be SQL-escaped.449 * @param mixed $default Optional. Default value to return if the option does not exist.457 * @param int $id A blog ID. Can be null to refer to the current blog. 458 * @param string $option Name of option to retrieve. Expected to not be SQL-escaped. 459 * @param mixed $default Optional. Default value to return if the option does not exist. 450 460 * @return mixed Value set for the option. 451 461 */ 452 462 function get_blog_option( $id, $option, $default = false ) { … … 489 499 * 490 500 * @since MU 491 501 * 492 * @param int $idA blog ID. Can be null to refer to the current blog.502 * @param int $id A blog ID. Can be null to refer to the current blog. 493 503 * @param string $option Name of option to add. Expected to not be SQL-escaped. 494 * @param mixed $valueOptional. Option value, can be anything. Expected to not be SQL-escaped.504 * @param mixed $value Optional. Option value, can be anything. Expected to not be SQL-escaped. 495 505 * @return bool False if option was not added and true if option was added. 496 506 */ 497 507 function add_blog_option( $id, $option, $value ) { … … 515 525 * 516 526 * @since MU 517 527 * 518 * @param int $idA blog ID. Can be null to refer to the current blog.528 * @param int $id A blog ID. Can be null to refer to the current blog. 519 529 * @param string $option Name of option to remove. Expected to not be SQL-escaped. 520 530 * @return bool True, if option is successfully deleted. False on failure. 521 531 */ … … 540 550 * 541 551 * @since MU 542 552 * 543 * @param int $idThe blog id553 * @param int $id The blog id 544 554 * @param string $option The option key 545 * @param mixed $valueThe option value555 * @param mixed $value The option value 546 556 * @return bool True on success, false on failure. 547 557 */ 548 558 function update_blog_option( $id, $option, $value, $deprecated = null ) { … … 576 586 * @see restore_current_blog() 577 587 * @since MU 578 588 * 579 * @param int $new_blog The id of the blog you want to switch to. Default: current blog 589 * @global wpdb $wpdb 590 * @global int $blog_id 591 * @global array $_wp_switched_stack 592 * @global bool $switched 593 * @global string $table_prefix 594 * @global WP_Object_Cache $wp_object_cache 595 * 596 * @param int $new_blog The id of the blog you want to switch to. Default: current blog 580 597 * @param bool $deprecated Deprecated argument 581 * @return boolAlways returns True.598 * @return true Always returns True. 582 599 */ 583 600 function switch_to_blog( $new_blog, $deprecated = null ) { 584 global $wpdb , $wp_roles;601 global $wpdb; 585 602 586 603 if ( empty( $new_blog ) ) 587 604 $new_blog = $GLOBALS['blog_id']; … … 635 652 } 636 653 637 654 if ( did_action( 'init' ) ) { 638 $wp_roles->reinit();655 wp_roles()->reinit(); 639 656 $current_user = wp_get_current_user(); 640 657 $current_user->for_blog( $new_blog ); 641 658 } … … 653 670 * @see switch_to_blog() 654 671 * @since MU 655 672 * 673 * @global wpdb $wpdb 674 * @global array $_wp_switched_stack 675 * @global int $blog_id 676 * @global bool $switched 677 * @global string $table_prefix 678 * @global WP_Object_Cache $wp_object_cache 679 * 656 680 * @return bool True on success, false if we're already on the current blog 657 681 */ 658 682 function restore_current_blog() { 659 global $wpdb , $wp_roles;683 global $wpdb; 660 684 661 685 if ( empty( $GLOBALS['_wp_switched_stack'] ) ) 662 686 return false; … … 699 723 } 700 724 701 725 if ( did_action( 'init' ) ) { 702 $wp_roles->reinit();726 wp_roles()->reinit(); 703 727 $current_user = wp_get_current_user(); 704 728 $current_user->for_blog( $blog ); 705 729 } … … 718 742 * 719 743 * @since 3.5.0 720 744 * 745 * @global array $_wp_switched_stack 746 * 721 747 * @return bool True if switched, false otherwise. 722 748 */ 723 749 function ms_is_switched() { … … 741 767 * 742 768 * @since MU 743 769 * 744 * @param int $idThe blog id770 * @param int $id The blog id 745 771 * @param string $archived The new status 746 772 * @return string $archived 747 773 */ … … 755 781 * 756 782 * @since MU 757 783 * 758 * @param int $blog_id BLog ID 759 * @param string $pref A field name 760 * @param string $value Value for $pref 761 * @return string $value 784 * @global wpdb $wpdb 785 * 786 * @param int $blog_id BLog ID 787 * @param string $pref A field name 788 * @param string $value Value for $pref 789 * @param null $deprecated 790 * @return string|false $value 762 791 */ 763 792 function update_blog_status( $blog_id, $pref, $value, $deprecated = null ) { 764 793 global $wpdb; … … 828 857 * 829 858 * @since MU 830 859 * 831 * @param int $id The blog id 860 * @global wpdb $wpdb 861 * 862 * @param int $id The blog id 832 863 * @param string $pref A field name 833 * @return bool $value864 * @return bool|string|null $value 834 865 */ 835 866 function get_blog_status( $id, $pref ) { 836 867 global $wpdb; … … 847 878 * 848 879 * @since MU 849 880 * 881 * @global wpdb $wpdb 882 * 850 883 * @param mixed $deprecated Not used 851 * @param int $startThe offset852 * @param int $quantityThe maximum number of blogs to retrieve. Default is 40.884 * @param int $start The offset 885 * @param int $quantity The maximum number of blogs to retrieve. Default is 40. 853 886 * @return array The list of blogs 854 887 */ 855 888 function get_last_updated( $deprecated = '', $start = 0, $quantity = 40 ) { … … 868 901 * 869 902 * @param string $new_status The new post status 870 903 * @param string $old_status The old post status 871 * @param object $post Post object904 * @param object $post Post object 872 905 */ 873 906 function _update_blog_date_on_post_publish( $new_status, $old_status, $post ) { 874 907 $post_type_obj = get_post_type_object( $post->post_type ); -
src/wp-includes/ms-default-constants.php
14 14 * wp-includes/ms-files.php (wp-content/blogs.php in MU). 15 15 * 16 16 * @since 3.0.0 17 * 18 * @global wpdb $wpdb 17 19 */ 18 20 function ms_upload_constants() { 19 21 global $wpdb; … … 114 116 * we will have translations loaded and can trigger warnings easily. 115 117 * 116 118 * @since 3.0.0 119 * 120 * @staticvar bool $subdomain_error 121 * @staticvar bool $subdomain_error_warn 117 122 */ 118 123 function ms_subdomain_constants() { 119 124 static $subdomain_error = null; … … 150 155 define( 'VHOST', 'no' ); 151 156 } 152 157 } 153 add_action( 'init', 'ms_subdomain_constants' ); -
src/wp-includes/ms-default-filters.php
13 13 * @since 3.0.0 14 14 */ 15 15 16 add_action( 'init', 'ms_subdomain_constants' ); 17 16 18 // Functions 17 19 add_action( 'update_option_blog_public', 'update_blog_public', 10, 2 ); 18 20 add_filter( 'option_users_can_register', 'users_can_register_signup_filter' ); -
src/wp-includes/ms-functions.php
28 28 * 29 29 * @since MU 1.0 30 30 * 31 * @global wpdb $wpdb 32 * 31 33 * @param string $sitedomain Optional. Site domain. 32 * @param string $path Optional. Site path.33 * @return array The network admins34 * @param string $path Optional. Site path. 35 * @return array|false The network admins 34 36 */ 35 37 function get_admin_users_for_domain( $sitedomain = '', $path = '' ) { 36 38 global $wpdb; … … 57 59 * 58 60 * @since MU 1.0 59 61 * 62 * @global wpdb $wpdb 63 * 60 64 * @param int $user_id The unique ID of the user 61 * @return object The blog object65 * @return object|void The blog object 62 66 */ 63 67 function get_active_blog_for_user( $user_id ) { 64 68 global $wpdb; 65 69 $blogs = get_blogs_of_user( $user_id ); 66 70 if ( empty( $blogs ) ) 67 return null;71 return; 68 72 69 73 if ( !is_multisite() ) 70 74 return $blogs[$wpdb->blogid]; … … 103 107 } 104 108 } 105 109 } else { 106 return null;110 return; 107 111 } 108 112 return $ret; 109 113 } else { … … 166 170 * 167 171 * @since MU 1.0 168 172 * 169 * @param int $blog_id ID of the blog you're adding the user to.170 * @param int $user_id ID of the user you're adding.171 * @param string $role The role you want the user to have172 * @return bool173 * @param int $blog_id ID of the blog you're adding the user to. 174 * @param int $user_id ID of the user you're adding. 175 * @param string $role The role you want the user to have 176 * @return true|WP_Error 173 177 */ 174 178 function add_user_to_blog( $blog_id, $user_id, $role ) { 175 179 switch_to_blog($blog_id); … … 215 219 * 216 220 * @since MU 1.0 217 221 * 218 * @param int $user_id ID of the user you're removing. 219 * @param int $blog_id ID of the blog you're removing the user from. 222 * @global wpdb $wpdb 223 * 224 * @param int $user_id ID of the user you're removing. 225 * @param int $blog_id ID of the blog you're removing the user from. 220 226 * @param string $reassign Optional. A user to whom to reassign posts. 221 * @return bool227 * @return true|WP_Error 222 228 */ 223 229 function remove_user_from_blog($user_id, $blog_id = '', $reassign = '') { 224 230 global $wpdb; … … 294 300 * 295 301 * @since MU 1.0 296 302 * 297 * @param string $domain The new blog's domain.298 * @param string $path The new blog's path.303 * @param string $domain The new blog's domain. 304 * @param string $path The new blog's path. 299 305 * @param string $weblog_title The new blog's title. 300 * @param int $site_idOptional. Defaults to 1.301 * @return int The ID of the newly created blog306 * @param int $site_id Optional. Defaults to 1. 307 * @return string|int The ID of the newly created blog 302 308 */ 303 309 function create_empty_blog( $domain, $path, $weblog_title, $site_id = 1 ) { 304 310 if ( empty($path) ) … … 349 355 * 350 356 * @since MU 2.6.5 351 357 * 358 * @global wpdb $wpdb 359 * 352 360 * @param string $domain 353 * @param string $path Optional. Not required for subdomain installations.361 * @param string $path Optional. Not required for subdomain installations. 354 362 * @return int 0 if no blog found, otherwise the ID of the matching blog 355 363 */ 356 364 function get_blog_id_from_url( $domain, $path = '/' ) { … … 447 455 * 448 456 * @since MU 449 457 * 458 * @global wpdb $wpdb 459 * 450 460 * @param string $user_name The login name provided by the user. 451 461 * @param string $user_email The email provided by the user. 452 462 * @return array Contains username, email, and error messages. … … 569 579 * 570 580 * @since MU 571 581 * 572 * @param string $blogname The blog name provided by the user. Must be unique. 582 * @global wpdb $wpdb 583 * @global string $domain 584 * 585 * @param string $blogname The blog name provided by the user. Must be unique. 573 586 * @param string $blog_title The blog title provided by the user. 574 587 * @return array Contains the new site data and error messages. 575 588 */ … … 700 713 * 701 714 * @since MU 702 715 * 703 * @param string $domain The requested domain. 704 * @param string $path The requested path. 705 * @param string $title The requested site title. 706 * @param string $user The user's requested login name. 716 * @global wpdb $wpdb 717 * 718 * @param string $domain The requested domain. 719 * @param string $path The requested path. 720 * @param string $title The requested site title. 721 * @param string $user The user's requested login name. 707 722 * @param string $user_email The user's email address. 708 * @param array $metaBy default, contains the requested privacy setting and lang_id.723 * @param array $meta By default, contains the requested privacy setting and lang_id. 709 724 */ 710 725 function wpmu_signup_blog( $domain, $path, $title, $user, $user_email, $meta = array() ) { 711 726 global $wpdb; … … 735 750 * 736 751 * @since MU 737 752 * 738 * @param string $user The user's requested login name. 753 * @global wpdb $wpdb 754 * 755 * @param string $user The user's requested login name. 739 756 * @param string $user_email The user's email address. 740 * @param array $metaBy default, this is an empty array.757 * @param array $meta By default, this is an empty array. 741 758 */ 742 759 function wpmu_signup_user( $user, $user_email, $meta = array() ) { 743 760 global $wpdb; … … 777 794 * 778 795 * @since MU 779 796 * 780 * @param string $domain The new blog domain.781 * @param string $path The new blog path.782 * @param string $title The site title.783 * @param string $user The user's login name.797 * @param string $domain The new blog domain. 798 * @param string $path The new blog path. 799 * @param string $title The site title. 800 * @param string $user The user's login name. 784 801 * @param string $user_email The user's email address. 785 * @param string $key The activation key created in wpmu_signup_blog()786 * @param array $metaBy default, contains the requested privacy setting and lang_id.802 * @param string $key The activation key created in wpmu_signup_blog() 803 * @param array $meta By default, contains the requested privacy setting and lang_id. 787 804 * @return bool 788 805 */ 789 806 function wpmu_signup_blog_notification( $domain, $path, $title, $user, $user_email, $key, $meta = array() ) { … … 883 900 * 884 901 * @since MU 885 902 * 886 * @param string $user The user's login name.903 * @param string $user The user's login name. 887 904 * @param string $user_email The user's email address. 888 * @param string $key The activation key created in wpmu_signup_user()889 * @param array $metaBy default, an empty array.905 * @param string $key The activation key created in wpmu_signup_user() 906 * @param array $meta By default, an empty array. 890 907 * @return bool 891 908 */ 892 909 function wpmu_signup_user_notification( $user, $user_email, $key, $meta = array() ) { … … 963 980 * 964 981 * @since MU 965 982 * 983 * @global wpdb $wpdb 984 * 966 985 * @param string $key The activation key provided to the user. 967 * @return array An array containing information about the activated user and/or blog986 * @return array|WP_Error An array containing information about the activated user and/or blog 968 987 */ 969 988 function wpmu_activate_signup($key) { 970 989 global $wpdb; … … 1058 1077 * @since MU 1059 1078 * 1060 1079 * @param string $user_name The new user's login name. 1061 * @param string $password The new user's password.1062 * @param string $email The new user's email address.1063 * @return int| boolReturns false on failure, or int $user_id on success1080 * @param string $password The new user's password. 1081 * @param string $email The new user's email address. 1082 * @return int|false Returns false on failure, or int $user_id on success 1064 1083 */ 1065 1084 function wpmu_create_user( $user_name, $password, $email ) { 1066 1085 $user_name = preg_replace( '/\s+/', '', sanitize_user( $user_name, true ) ); … … 1099 1118 * 1100 1119 * @since MU 1101 1120 * 1102 * @param string $domain The new site's domain.1103 * @param string $path The new site's path.1104 * @param string $title The new site's title.1105 * @param int $user_id The user ID of the new site's admin.1106 * @param array $metaOptional. Used to set initial site options.1107 * @param int $site_id Optional. Only relevant on multi-network installs.1108 * @return mixedReturns WP_Error object on failure, int $blog_id on success1121 * @param string $domain The new site's domain. 1122 * @param string $path The new site's path. 1123 * @param string $title The new site's title. 1124 * @param int $user_id The user ID of the new site's admin. 1125 * @param array $meta Optional. Used to set initial site options. 1126 * @param int $site_id Optional. Only relevant on multi-network installs. 1127 * @return int|WP_Error Returns WP_Error object on failure, int $blog_id on success 1109 1128 */ 1110 1129 function wpmu_create_blog( $domain, $path, $title, $user_id, $meta = array(), $site_id = 1 ) { 1111 1130 $defaults = array( 'public' => 0 ); … … 1264 1283 * 1265 1284 * @since MU 1266 1285 * 1267 * @param string $domain The domain to be checked. 1268 * @param string $path The path to be checked. 1269 * @param int $site_id Optional. Relevant only on multi-network installs. 1286 * @global wpdb $wpdb 1287 * 1288 * @param string $domain The domain to be checked. 1289 * @param string $path The path to be checked. 1290 * @param int $site_id Optional. Relevant only on multi-network installs. 1270 1291 * @return int 1271 1292 */ 1272 1293 function domain_exists($domain, $path, $site_id = 1) { … … 1295 1316 * 1296 1317 * @since MU 1297 1318 * 1298 * @param string $domain The domain of the new site. 1299 * @param string $path The path of the new site. 1300 * @param int $site_id Unless you're running a multi-network install, be sure to set this value to 1. 1301 * @return int The ID of the new row 1319 * @global wpdb $wpdb 1320 * 1321 * @param string $domain The domain of the new site. 1322 * @param string $path The path of the new site. 1323 * @param int $site_id Unless you're running a multi-network install, be sure to set this value to 1. 1324 * @return int|false The ID of the new row 1302 1325 */ 1303 1326 function insert_blog($domain, $path, $site_id) { 1304 1327 global $wpdb; … … 1327 1350 * 1328 1351 * @since MU 1329 1352 * 1330 * @param int $blog_id The value returned by insert_blog(). 1353 * @global wpdb $wpdb 1354 * 1355 * @param int $blog_id The value returned by insert_blog(). 1331 1356 * @param string $blog_title The title of the new site. 1332 1357 */ 1333 1358 function install_blog( $blog_id, $blog_title = '' ) { 1334 global $wpdb , $wp_roles;1359 global $wpdb; 1335 1360 1336 1361 // Cast for security 1337 1362 $blog_id = (int) $blog_id; … … 1351 1376 populate_roles(); 1352 1377 1353 1378 // populate_roles() clears previous role definitions so we start over. 1354 $wp_roles = new WP_Roles();1379 wp_roles(); 1355 1380 1356 1381 $url = untrailingslashit( $url ); 1357 1382 … … 1381 1406 * @deprecated MU 1382 1407 * @deprecated Use wp_install_defaults() 1383 1408 * 1409 * @global wpdb $wpdb 1410 * 1384 1411 * @param int $blog_id Ignored in this function. 1385 1412 * @param int $user_id 1386 1413 */ … … 1406 1433 * 1407 1434 * @since MU 1408 1435 * 1409 * @param int $blog_id1410 * @param int $user_id1436 * @param int $blog_id 1437 * @param int $user_id 1411 1438 * @param string $password 1412 * @param string $title The new blog's title1413 * @param array $metaOptional. Not used in the default function, but is passed along to hooks for customization.1439 * @param string $title The new blog's title 1440 * @param array $meta Optional. Not used in the default function, but is passed along to hooks for customization. 1414 1441 * @return bool 1415 1442 */ 1416 1443 function wpmu_welcome_notification( $blog_id, $user_id, $password, $title, $meta = array() ) { … … 1509 1536 * 1510 1537 * @since MU 1511 1538 * 1512 * @param int $user_id1539 * @param int $user_id 1513 1540 * @param string $password 1514 * @param array $metaOptional. Not used in the default function, but is passed along to hooks for customization.1541 * @param array $meta Optional. Not used in the default function, but is passed along to hooks for customization. 1515 1542 * @return bool 1516 1543 */ 1517 1544 function wpmu_welcome_user_notification( $user_id, $password, $meta = array() ) { … … 1587 1614 * 1588 1615 * @since MU 1589 1616 * 1617 * @global object $current_site 1618 * 1590 1619 * @return object 1591 1620 */ 1592 1621 function get_current_site() { … … 1602 1631 * 1603 1632 * @since MU 1604 1633 * 1634 * @global wpdb $wpdb 1635 * 1605 1636 * @param int $user_id 1606 1637 * @return array Contains the blog_id, post_id, post_date_gmt, and post_gmt_ts 1607 1638 */ … … 1674 1705 * @since MU 1675 1706 * 1676 1707 * @param string $directory 1677 * @return int 1708 * @return int|false 1678 1709 */ 1679 1710 function recurse_dirsize( $directory ) { 1680 1711 $size = 0; … … 1737 1768 * are published or unpublished to make sure the count stays current. 1738 1769 * 1739 1770 * @since MU 1771 * 1772 * @global wpdb $wpdb 1740 1773 */ 1741 1774 function update_posts_count( $deprecated = '' ) { 1742 1775 global $wpdb; … … 1748 1781 * 1749 1782 * @since MU 1750 1783 * 1784 * @global wpdb $wpdb 1785 * 1751 1786 * @param int $blog_id 1752 1787 * @param int $user_id 1753 1788 */ … … 1765 1800 * 1766 1801 * @see term_id_filter 1767 1802 * 1803 * @global wpdb $wpdb 1804 * @staticvar int $global_terms_recurse 1805 * 1768 1806 * @param int $term_id An ID for a term on the current blog. 1769 1807 * @return int An ID from the global terms table mapped from $term_id. 1770 1808 */ … … 1846 1884 * @since MU 1847 1885 * 1848 1886 * @param array $upload 1849 * @return mixedIf the upload is under the size limit, $upload is returned. Otherwise returns an error message.1887 * @return string|array If the upload is under the size limit, $upload is returned. Otherwise returns an error message. 1850 1888 */ 1851 1889 function upload_is_file_too_big( $upload ) { 1852 if ( is_array( $upload ) == false|| defined( 'WP_IMPORTING' ) || get_site_option( 'upload_space_check_disabled' ) )1890 if ( ! is_array( $upload ) || defined( 'WP_IMPORTING' ) || get_site_option( 'upload_space_check_disabled' ) ) 1853 1891 return $upload; 1854 1892 1855 1893 if ( strlen( $upload['bits'] ) > ( 1024 * get_site_option( 'fileupload_maxk', 1500 ) ) ) … … 1921 1959 */ 1922 1960 function maybe_add_existing_user_to_blog() { 1923 1961 if ( false === strpos( $_SERVER[ 'REQUEST_URI' ], '/newbloguser/' ) ) 1924 return false;1962 return; 1925 1963 1926 1964 $parts = explode( '/', $_SERVER[ 'REQUEST_URI' ] ); 1927 1965 $key = array_pop( $parts ); … … 1944 1982 * 1945 1983 * @since MU 1946 1984 * 1985 * @global int $blog_id 1986 * 1947 1987 * @param array $details 1988 * @return true|WP_Error|void 1948 1989 */ 1949 1990 function add_existing_user_to_blog( $details = false ) { 1950 1991 global $blog_id; … … 1960 2001 * @param mixed $result True on success or a WP_Error object if the user doesn't exist. 1961 2002 */ 1962 2003 do_action( 'added_existing_user', $details['user_id'], $result ); 2004 return $result; 1963 2005 } 1964 return $result;1965 2006 } 1966 2007 1967 2008 /** … … 1973 2014 * @since MU 1974 2015 * @see add_user_to_blog() 1975 2016 * 1976 * @param int $user_id2017 * @param int $user_id 1977 2018 * @param mixed $password Ignored. 1978 2019 * @param array $meta 1979 2020 */ … … 2002 2043 * @since MU 2003 2044 * 2004 2045 * @param string|WP_User $user Optional. Defaults to current user. WP_User object, 2005 * or user login name as a string.2046 * or user login name as a string. 2006 2047 * @return bool 2007 2048 */ 2008 2049 function is_user_spammy( $user = null ) { … … 2025 2066 * @since MU 2026 2067 * 2027 2068 * @param int $old_value 2028 * @param int $value The new public value2069 * @param int $value The new public value 2029 2070 */ 2030 2071 function update_blog_public( $old_value, $value ) { 2031 2072 update_blog_status( get_current_blog_id(), 'public', (int) $value ); … … 2036 2077 * 2037 2078 * @since MU 2038 2079 * 2080 * @global wpdb $wpdb 2081 * 2039 2082 * @param string $key 2040 * @param int $user_id Optional. Defaults to current user.2041 * @param int $blog_id Optional. Defaults to current blog.2083 * @param int $user_id Optional. Defaults to current user. 2084 * @param int $blog_id Optional. Defaults to current blog. 2042 2085 * @return bool 2043 2086 */ 2044 2087 function is_user_option_local( $key, $user_id = 0, $blog_id = 0 ) { … … 2050 2093 } 2051 2094 $local_key = $wpdb->get_blog_prefix( $blog_id ) . $key; 2052 2095 2053 if ( isset( $current_user->$local_key ) ) 2054 return true; 2055 2056 return false; 2096 return isset( $current_user->$local_key ); 2057 2097 } 2058 2098 2059 2099 /** … … 2065 2105 */ 2066 2106 function users_can_register_signup_filter() { 2067 2107 $registration = get_site_option('registration'); 2068 if ( $registration == 'all' || $registration == 'user' ) 2069 return true; 2070 2071 return false; 2108 return ( $registration == 'all' || $registration == 'user' ); 2072 2109 } 2073 2110 2074 2111 /** … … 2106 2143 * 2107 2144 * @since 2.8.5 2108 2145 * 2146 * @staticvar bool $forced_content 2147 * 2109 2148 * @param string|bool $force 2110 2149 * @return bool True if forced, false if not forced. 2111 2150 */ … … 2213 2252 * Update the network-wide site count. 2214 2253 * 2215 2254 * @since 3.7.0 2255 * 2256 * @global wpdb $wpdb 2216 2257 */ 2217 2258 function wp_update_network_site_counts() { 2218 2259 global $wpdb; … … 2225 2266 * Update the network-wide user count. 2226 2267 * 2227 2268 * @since 3.7.0 2269 * 2270 * @global wpdb $wpdb 2228 2271 */ 2229 2272 function wp_update_network_user_counts() { 2230 2273 global $wpdb; … … 2365 2408 * 2366 2409 * @since 3.7.0 2367 2410 * 2411 * @global wpdb $wpdb 2412 * 2368 2413 * @param array $args { 2369 2414 * Array of default arguments. Optional. 2370 2415 * -
src/wp-includes/ms-load.php
19 19 if ( defined('SUBDOMAIN_INSTALL') ) 20 20 return SUBDOMAIN_INSTALL; 21 21 22 if ( defined('VHOST') && VHOST == 'yes' ) 23 return true; 24 25 return false; 22 return ( defined( 'VHOST' ) && VHOST == 'yes' ); 26 23 } 27 24 28 25 /** … … 68 65 * 69 66 * @since 3.0.0 70 67 * 71 * @return bool|string Returns true on success, or drop-in file to include.68 * @return true|string Returns true on success, or drop-in file to include. 72 69 */ 73 70 function ms_site_check() { 74 71 $blog = get_blog_details(); … … 117 114 * 118 115 * @since 3.9.0 119 116 * 117 * @global wpdb $wpdb 118 * 120 119 * @param string $domain Domain to check. 121 120 * @param string $path Path to check. 122 121 * @param int|null $segments Path segments to use. Defaults to null, or the full path. 123 * @return object| boolNetwork object if successful. False when no network is found.122 * @return object|false Network object if successful. False when no network is found. 124 123 */ 125 124 function get_network_by_path( $domain, $path, $segments = null ) { 126 125 global $wpdb; … … 260 259 * 261 260 * @since 3.9.0 262 261 * 262 * @global wpdb $wpdb 263 * 263 264 * @param object|int $network The network's database row or ID. 264 * @return object| boolObject containing network information if found, false if not.265 * @return object|false Object containing network information if found, false if not. 265 266 */ 266 267 function wp_get_network( $network ) { 267 268 global $wpdb; … … 281 282 * 282 283 * @since 3.9.0 283 284 * 285 * @global wpdb $wpdb 286 * 284 287 * @param string $domain Domain to check. 285 288 * @param string $path Path to check. 286 289 * @param int|null $segments Path segments to use. Defaults to null, or the full path. 287 * @return object| boolSite object if successful. False when no site is found.290 * @return object|false Site object if successful. False when no site is found. 288 291 */ 289 292 function get_site_by_path( $domain, $path, $segments = null ) { 290 293 global $wpdb; … … 391 394 * 392 395 * @access private 393 396 * @since 3.0.0 397 * 398 * @global wpdb $wpdb 399 * @global string $domain 400 * @global string $path 394 401 */ 395 402 function ms_not_installed() { 396 403 global $wpdb, $domain, $path; … … 463 470 * @since 3.0.0 464 471 * @deprecated 3.9.0 465 472 * 473 * @global object $current_site 474 * 466 475 * @return object 467 476 */ 468 477 function wpmu_current_site() {