Make WordPress Core

Ticket #32444: 32444.5.diff

File 32444.5.diff, 27.0 KB (added by wonderboymusic, 9 years ago)
  • src/wp-includes/ms-blogs.php

     
    1212 * Update the last_updated field for the current blog.
    1313 *
    1414 * @since MU
     15 *
     16 * @global wpdb $wpdb
    1517 */
    1618function wpmu_update_blogs_date() {
    1719        global $wpdb;
     
    6668 *
    6769 * @since MU
    6870 *
     71 * @global wpdb $wpdb
     72 *
    6973 * @param string $slug
    7074 * @return int A blog id
    7175 */
     
    97101 *
    98102 * @since MU
    99103 *
    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.
    102110 * @return object|false Blog details on success. False on failure.
    103111 */
    104112function get_blog_details( $fields = null, $get_all = true ) {
     
    272280 *
    273281 * @since MU
    274282 *
    275  * @param int $blog_id Blog ID
     283 * @global wpdb $wpdb
     284 *
     285 * @param int   $blog_id Blog ID
    276286 * @param array $details Array of details keyed by blogs table field names.
    277287 * @return bool True if update succeeds, false otherwise.
    278288 */
     
    444454 *
    445455 * @since MU
    446456 *
    447  * @param int $id A 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.
    450460 * @return mixed Value set for the option.
    451461 */
    452462function get_blog_option( $id, $option, $default = false ) {
     
    489499 *
    490500 * @since MU
    491501 *
    492  * @param int $id A 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.
    493503 * @param string $option Name of option to add. Expected to not be SQL-escaped.
    494  * @param mixed $value Optional. 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.
    495505 * @return bool False if option was not added and true if option was added.
    496506 */
    497507function add_blog_option( $id, $option, $value ) {
     
    515525 *
    516526 * @since MU
    517527 *
    518  * @param int $id A 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.
    519529 * @param string $option Name of option to remove. Expected to not be SQL-escaped.
    520530 * @return bool True, if option is successfully deleted. False on failure.
    521531 */
     
    540550 *
    541551 * @since MU
    542552 *
    543  * @param int $id The blog id
     553 * @param int    $id    The blog id
    544554 * @param string $option The option key
    545  * @param mixed $value The option value
     555 * @param mixed  $value The option value
    546556 * @return bool True on success, false on failure.
    547557 */
    548558function update_blog_option( $id, $option, $value, $deprecated = null ) {
     
    576586 * @see restore_current_blog()
    577587 * @since MU
    578588 *
    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
    580597 * @param bool $deprecated Deprecated argument
    581  * @return bool Always returns True.
     598 * @return true Always returns True.
    582599 */
    583600function switch_to_blog( $new_blog, $deprecated = null ) {
    584         global $wpdb, $wp_roles;
     601        global $wpdb;
    585602
    586603        if ( empty( $new_blog ) )
    587604                $new_blog = $GLOBALS['blog_id'];
     
    635652        }
    636653
    637654        if ( did_action( 'init' ) ) {
    638                 $wp_roles->reinit();
     655                wp_roles()->reinit();
    639656                $current_user = wp_get_current_user();
    640657                $current_user->for_blog( $new_blog );
    641658        }
     
    653670 * @see switch_to_blog()
    654671 * @since MU
    655672 *
     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 *
    656680 * @return bool True on success, false if we're already on the current blog
    657681 */
    658682function restore_current_blog() {
    659         global $wpdb, $wp_roles;
     683        global $wpdb;
    660684
    661685        if ( empty( $GLOBALS['_wp_switched_stack'] ) )
    662686                return false;
     
    699723        }
    700724
    701725        if ( did_action( 'init' ) ) {
    702                 $wp_roles->reinit();
     726                wp_roles()->reinit();
    703727                $current_user = wp_get_current_user();
    704728                $current_user->for_blog( $blog );
    705729        }
     
    718742 *
    719743 * @since 3.5.0
    720744 *
     745 * @global array $_wp_switched_stack
     746 *
    721747 * @return bool True if switched, false otherwise.
    722748 */
    723749function ms_is_switched() {
     
    741767 *
    742768 * @since MU
    743769 *
    744  * @param int $id The blog id
     770 * @param int    $id      The blog id
    745771 * @param string $archived The new status
    746772 * @return string $archived
    747773 */
     
    755781 *
    756782 * @since MU
    757783 *
    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
    762791 */
    763792function update_blog_status( $blog_id, $pref, $value, $deprecated = null ) {
    764793        global $wpdb;
     
    828857 *
    829858 * @since MU
    830859 *
    831  * @param int $id The blog id
     860 * @global wpdb $wpdb
     861 *
     862 * @param int    $id   The blog id
    832863 * @param string $pref A field name
    833  * @return bool $value
     864 * @return bool|string|null $value
    834865 */
    835866function get_blog_status( $id, $pref ) {
    836867        global $wpdb;
     
    847878 *
    848879 * @since MU
    849880 *
     881 * @global wpdb $wpdb
     882 *
    850883 * @param mixed $deprecated Not used
    851  * @param int $start The offset
    852  * @param int $quantity The 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.
    853886 * @return array The list of blogs
    854887 */
    855888function get_last_updated( $deprecated = '', $start = 0, $quantity = 40 ) {
     
    868901 *
    869902 * @param string $new_status The new post status
    870903 * @param string $old_status The old post status
    871  * @param object $post Post object
     904 * @param object $post       Post object
    872905 */
    873906function _update_blog_date_on_post_publish( $new_status, $old_status, $post ) {
    874907        $post_type_obj = get_post_type_object( $post->post_type );
  • src/wp-includes/ms-default-constants.php

     
    1414 * wp-includes/ms-files.php (wp-content/blogs.php in MU).
    1515 *
    1616 * @since 3.0.0
     17 *
     18 * @global wpdb $wpdb
    1719 */
    1820function ms_upload_constants() {
    1921        global $wpdb;
     
    114116 * we will have translations loaded and can trigger warnings easily.
    115117 *
    116118 * @since 3.0.0
     119 *
     120 * @staticvar bool $subdomain_error
     121 * @staticvar bool $subdomain_error_warn
    117122 */
    118123function ms_subdomain_constants() {
    119124        static $subdomain_error = null;
     
    150155                define( 'VHOST', 'no' );
    151156        }
    152157}
    153 add_action( 'init', 'ms_subdomain_constants' );
  • src/wp-includes/ms-default-filters.php

     
    1313 * @since 3.0.0
    1414 */
    1515
     16add_action( 'init', 'ms_subdomain_constants' );
     17
    1618// Functions
    1719add_action( 'update_option_blog_public', 'update_blog_public', 10, 2 );
    1820add_filter( 'option_users_can_register', 'users_can_register_signup_filter' );
  • src/wp-includes/ms-functions.php

     
    2828 *
    2929 * @since MU 1.0
    3030 *
     31 * @global wpdb $wpdb
     32 *
    3133 * @param string $sitedomain Optional. Site domain.
    32  * @param string $path Optional. Site path.
    33  * @return array The network admins
     34 * @param string $path       Optional. Site path.
     35 * @return array|false The network admins
    3436 */
    3537function get_admin_users_for_domain( $sitedomain = '', $path = '' ) {
    3638        global $wpdb;
     
    5759 *
    5860 * @since MU 1.0
    5961 *
     62 * @global wpdb $wpdb
     63 *
    6064 * @param int $user_id The unique ID of the user
    61  * @return object The blog object
     65 * @return object|void The blog object
    6266 */
    6367function get_active_blog_for_user( $user_id ) {
    6468        global $wpdb;
    6569        $blogs = get_blogs_of_user( $user_id );
    6670        if ( empty( $blogs ) )
    67                 return null;
     71                return;
    6872
    6973        if ( !is_multisite() )
    7074                return $blogs[$wpdb->blogid];
     
    103107                                }
    104108                        }
    105109                } else {
    106                         return null;
     110                        return;
    107111                }
    108112                return $ret;
    109113        } else {
     
    166170 *
    167171 * @since MU 1.0
    168172 *
    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 have
    172  * @return bool
     173 * @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
    173177 */
    174178function add_user_to_blog( $blog_id, $user_id, $role ) {
    175179        switch_to_blog($blog_id);
     
    215219 *
    216220 * @since MU 1.0
    217221 *
    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.
    220226 * @param string $reassign Optional. A user to whom to reassign posts.
    221  * @return bool
     227 * @return true|WP_Error
    222228 */
    223229function remove_user_from_blog($user_id, $blog_id = '', $reassign = '') {
    224230        global $wpdb;
     
    294300 *
    295301 * @since MU 1.0
    296302 *
    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.
    299305 * @param string $weblog_title The new blog's title.
    300  * @param int $site_id Optional. Defaults to 1.
    301  * @return int The ID of the newly created blog
     306 * @param int    $site_id      Optional. Defaults to 1.
     307 * @return string|int The ID of the newly created blog
    302308 */
    303309function create_empty_blog( $domain, $path, $weblog_title, $site_id = 1 ) {
    304310        if ( empty($path) )
     
    349355 *
    350356 * @since MU 2.6.5
    351357 *
     358 * @global wpdb $wpdb
     359 *
    352360 * @param string $domain
    353  * @param string $path Optional. Not required for subdomain installations.
     361 * @param string $path   Optional. Not required for subdomain installations.
    354362 * @return int 0 if no blog found, otherwise the ID of the matching blog
    355363 */
    356364function get_blog_id_from_url( $domain, $path = '/' ) {
     
    447455 *
    448456 * @since MU
    449457 *
     458 * @global wpdb $wpdb
     459 *
    450460 * @param string $user_name  The login name provided by the user.
    451461 * @param string $user_email The email provided by the user.
    452462 * @return array Contains username, email, and error messages.
     
    569579 *
    570580 * @since MU
    571581 *
    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.
    573586 * @param string $blog_title The blog title provided by the user.
    574587 * @return array Contains the new site data and error messages.
    575588 */
     
    700713 *
    701714 * @since MU
    702715 *
    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.
    707722 * @param string $user_email The user's email address.
    708  * @param array $meta By default, contains the requested privacy setting and lang_id.
     723 * @param array  $meta      By default, contains the requested privacy setting and lang_id.
    709724 */
    710725function wpmu_signup_blog( $domain, $path, $title, $user, $user_email, $meta = array() )  {
    711726        global $wpdb;
     
    735750 *
    736751 * @since MU
    737752 *
    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.
    739756 * @param string $user_email The user's email address.
    740  * @param array $meta By default, this is an empty array.
     757 * @param array  $meta      By default, this is an empty array.
    741758 */
    742759function wpmu_signup_user( $user, $user_email, $meta = array() ) {
    743760        global $wpdb;
     
    777794 *
    778795 * @since MU
    779796 *
    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.
    784801 * @param string $user_email The user's email address.
    785  * @param string $key The activation key created in wpmu_signup_blog()
    786  * @param array $meta By 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.
    787804 * @return bool
    788805 */
    789806function wpmu_signup_blog_notification( $domain, $path, $title, $user, $user_email, $key, $meta = array() ) {
     
    883900 *
    884901 * @since MU
    885902 *
    886  * @param string $user The user's login name.
     903 * @param string $user       The user's login name.
    887904 * @param string $user_email The user's email address.
    888  * @param string $key The activation key created in wpmu_signup_user()
    889  * @param array $meta By 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.
    890907 * @return bool
    891908 */
    892909function wpmu_signup_user_notification( $user, $user_email, $key, $meta = array() ) {
     
    963980 *
    964981 * @since MU
    965982 *
     983 * @global wpdb $wpdb
     984 *
    966985 * @param string $key The activation key provided to the user.
    967  * @return array An array containing information about the activated user and/or blog
     986 * @return array|WP_Error An array containing information about the activated user and/or blog
    968987 */
    969988function wpmu_activate_signup($key) {
    970989        global $wpdb;
     
    10581077 * @since MU
    10591078 *
    10601079 * @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|bool Returns false on failure, or int $user_id on success
     1080 * @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
    10641083 */
    10651084function wpmu_create_user( $user_name, $password, $email ) {
    10661085        $user_name = preg_replace( '/\s+/', '', sanitize_user( $user_name, true ) );
     
    10991118 *
    11001119 * @since MU
    11011120 *
    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 $meta Optional. Used to set initial site options.
    1107  * @param int $site_id Optional. Only relevant on multi-network installs.
    1108  * @return mixed Returns WP_Error object on failure, int $blog_id on success
     1121 * @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
    11091128 */
    11101129function wpmu_create_blog( $domain, $path, $title, $user_id, $meta = array(), $site_id = 1 ) {
    11111130        $defaults = array( 'public' => 0 );
     
    12641283 *
    12651284 * @since MU
    12661285 *
    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.
    12701291 * @return int
    12711292 */
    12721293function domain_exists($domain, $path, $site_id = 1) {
     
    12951316 *
    12961317 * @since MU
    12971318 *
    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
    13021325 */
    13031326function insert_blog($domain, $path, $site_id) {
    13041327        global $wpdb;
     
    13271350 *
    13281351 * @since MU
    13291352 *
    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().
    13311356 * @param string $blog_title The title of the new site.
    13321357 */
    13331358function install_blog( $blog_id, $blog_title = '' ) {
    1334         global $wpdb, $wp_roles;
     1359        global $wpdb;
    13351360
    13361361        // Cast for security
    13371362        $blog_id = (int) $blog_id;
     
    13511376        populate_roles();
    13521377
    13531378        // populate_roles() clears previous role definitions so we start over.
    1354         $wp_roles = new WP_Roles();
     1379        wp_roles();
    13551380
    13561381        $url = untrailingslashit( $url );
    13571382
     
    13811406 * @deprecated MU
    13821407 * @deprecated Use wp_install_defaults()
    13831408 *
     1409 * @global wpdb $wpdb
     1410 *
    13841411 * @param int $blog_id Ignored in this function.
    13851412 * @param int $user_id
    13861413 */
     
    14061433 *
    14071434 * @since MU
    14081435 *
    1409  * @param int $blog_id
    1410  * @param int $user_id
     1436 * @param int    $blog_id
     1437 * @param int    $user_id
    14111438 * @param string $password
    1412  * @param string $title The new blog's title
    1413  * @param array $meta Optional. 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.
    14141441 * @return bool
    14151442 */
    14161443function wpmu_welcome_notification( $blog_id, $user_id, $password, $title, $meta = array() ) {
     
    15091536 *
    15101537 * @since MU
    15111538 *
    1512  * @param int $user_id
     1539 * @param int    $user_id
    15131540 * @param string $password
    1514  * @param array $meta Optional. 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.
    15151542 * @return bool
    15161543 */
    15171544function wpmu_welcome_user_notification( $user_id, $password, $meta = array() ) {
     
    15871614 *
    15881615 * @since MU
    15891616 *
     1617 * @global object $current_site
     1618 *
    15901619 * @return object
    15911620 */
    15921621function get_current_site() {
     
    16021631 *
    16031632 * @since MU
    16041633 *
     1634 * @global wpdb $wpdb
     1635 *
    16051636 * @param int $user_id
    16061637 * @return array Contains the blog_id, post_id, post_date_gmt, and post_gmt_ts
    16071638 */
     
    16741705 * @since MU
    16751706 *
    16761707 * @param string $directory
    1677  * @return int
     1708 * @return int|false
    16781709 */
    16791710function recurse_dirsize( $directory ) {
    16801711        $size = 0;
     
    17371768 * are published or unpublished to make sure the count stays current.
    17381769 *
    17391770 * @since MU
     1771 *
     1772 * @global wpdb $wpdb
    17401773 */
    17411774function update_posts_count( $deprecated = '' ) {
    17421775        global $wpdb;
     
    17481781 *
    17491782 * @since MU
    17501783 *
     1784 * @global wpdb $wpdb
     1785 *
    17511786 * @param int $blog_id
    17521787 * @param int $user_id
    17531788 */
     
    17651800 *
    17661801 * @see term_id_filter
    17671802 *
     1803 * @global wpdb $wpdb
     1804 * @staticvar int $global_terms_recurse
     1805 *
    17681806 * @param int $term_id An ID for a term on the current blog.
    17691807 * @return int An ID from the global terms table mapped from $term_id.
    17701808 */
     
    18461884 * @since MU
    18471885 *
    18481886 * @param array $upload
    1849  * @return mixed If 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.
    18501888 */
    18511889function 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' ) )
    18531891                return $upload;
    18541892
    18551893        if ( strlen( $upload['bits'] )  > ( 1024 * get_site_option( 'fileupload_maxk', 1500 ) ) )
     
    19211959 */
    19221960function maybe_add_existing_user_to_blog() {
    19231961        if ( false === strpos( $_SERVER[ 'REQUEST_URI' ], '/newbloguser/' ) )
    1924                 return false;
     1962                return;
    19251963
    19261964        $parts = explode( '/', $_SERVER[ 'REQUEST_URI' ] );
    19271965        $key = array_pop( $parts );
     
    19441982 *
    19451983 * @since MU
    19461984 *
     1985 * @global int $blog_id
     1986 *
    19471987 * @param array $details
     1988 * @return true|WP_Error|void
    19481989 */
    19491990function add_existing_user_to_blog( $details = false ) {
    19501991        global $blog_id;
     
    19602001                 * @param mixed $result  True on success or a WP_Error object if the user doesn't exist.
    19612002                 */
    19622003                do_action( 'added_existing_user', $details['user_id'], $result );
     2004                return $result;
    19632005        }
    1964         return $result;
    19652006}
    19662007
    19672008/**
     
    19732014 * @since MU
    19742015 * @see add_user_to_blog()
    19752016 *
    1976  * @param int $user_id
     2017 * @param int   $user_id
    19772018 * @param mixed $password Ignored.
    19782019 * @param array $meta
    19792020 */
     
    20022043 * @since MU
    20032044 *
    20042045 * @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.
    20062047 * @return bool
    20072048 */
    20082049function is_user_spammy( $user = null ) {
     
    20252066 * @since MU
    20262067 *
    20272068 * @param int $old_value
    2028  * @param int $value The new public value
     2069 * @param int $value     The new public value
    20292070 */
    20302071function update_blog_public( $old_value, $value ) {
    20312072        update_blog_status( get_current_blog_id(), 'public', (int) $value );
     
    20362077 *
    20372078 * @since MU
    20382079 *
     2080 * @global wpdb $wpdb
     2081 *
    20392082 * @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.
    20422085 * @return bool
    20432086 */
    20442087function is_user_option_local( $key, $user_id = 0, $blog_id = 0 ) {
     
    20502093        }
    20512094        $local_key = $wpdb->get_blog_prefix( $blog_id ) . $key;
    20522095
    2053         if ( isset( $current_user->$local_key ) )
    2054                 return true;
    2055 
    2056         return false;
     2096        return isset( $current_user->$local_key );
    20572097}
    20582098
    20592099/**
     
    20652105 */
    20662106function users_can_register_signup_filter() {
    20672107        $registration = get_site_option('registration');
    2068         if ( $registration == 'all' || $registration == 'user' )
    2069                 return true;
    2070 
    2071         return false;
     2108        return ( $registration == 'all' || $registration == 'user' );
    20722109}
    20732110
    20742111/**
     
    21062143 *
    21072144 * @since 2.8.5
    21082145 *
     2146 * @staticvar bool $forced_content
     2147 *
    21092148 * @param string|bool $force
    21102149 * @return bool True if forced, false if not forced.
    21112150 */
     
    22132252 * Update the network-wide site count.
    22142253 *
    22152254 * @since 3.7.0
     2255 *
     2256 * @global wpdb $wpdb
    22162257 */
    22172258function wp_update_network_site_counts() {
    22182259        global $wpdb;
     
    22252266 * Update the network-wide user count.
    22262267 *
    22272268 * @since 3.7.0
     2269 *
     2270 * @global wpdb $wpdb
    22282271 */
    22292272function wp_update_network_user_counts() {
    22302273        global $wpdb;
     
    23652408 *
    23662409 * @since 3.7.0
    23672410 *
     2411 * @global wpdb $wpdb
     2412 *
    23682413 * @param array $args {
    23692414 *     Array of default arguments. Optional.
    23702415 *
  • src/wp-includes/ms-load.php

     
    1919        if ( defined('SUBDOMAIN_INSTALL') )
    2020                return SUBDOMAIN_INSTALL;
    2121
    22         if ( defined('VHOST') && VHOST == 'yes' )
    23                 return true;
    24 
    25         return false;
     22        return ( defined( 'VHOST' ) && VHOST == 'yes' );
    2623}
    2724
    2825/**
     
    6865 *
    6966 * @since 3.0.0
    7067 *
    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.
    7269 */
    7370function ms_site_check() {
    7471        $blog = get_blog_details();
     
    117114 *
    118115 * @since 3.9.0
    119116 *
     117 * @global wpdb $wpdb
     118 *
    120119 * @param string   $domain   Domain to check.
    121120 * @param string   $path     Path to check.
    122121 * @param int|null $segments Path segments to use. Defaults to null, or the full path.
    123  * @return object|bool Network object if successful. False when no network is found.
     122 * @return object|false Network object if successful. False when no network is found.
    124123 */
    125124function get_network_by_path( $domain, $path, $segments = null ) {
    126125        global $wpdb;
     
    260259 *
    261260 * @since 3.9.0
    262261 *
     262 * @global wpdb $wpdb
     263 *
    263264 * @param object|int $network The network's database row or ID.
    264  * @return object|bool Object containing network information if found, false if not.
     265 * @return object|false Object containing network information if found, false if not.
    265266 */
    266267function wp_get_network( $network ) {
    267268        global $wpdb;
     
    281282 *
    282283 * @since 3.9.0
    283284 *
     285 * @global wpdb $wpdb
     286 *
    284287 * @param string   $domain   Domain to check.
    285288 * @param string   $path     Path to check.
    286289 * @param int|null $segments Path segments to use. Defaults to null, or the full path.
    287  * @return object|bool Site object if successful. False when no site is found.
     290 * @return object|false Site object if successful. False when no site is found.
    288291 */
    289292function get_site_by_path( $domain, $path, $segments = null ) {
    290293        global $wpdb;
     
    391394 *
    392395 * @access private
    393396 * @since 3.0.0
     397 *
     398 * @global wpdb   $wpdb
     399 * @global string $domain
     400 * @global string $path
    394401 */
    395402function ms_not_installed() {
    396403        global $wpdb, $domain, $path;
     
    463470 * @since 3.0.0
    464471 * @deprecated 3.9.0
    465472 *
     473 * @global object $current_site
     474 *
    466475 * @return object
    467476 */
    468477function wpmu_current_site() {