WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/26/2015 09:50:13 PM (7 years ago)
Author:
wonderboymusic
Message:

Fix doc blocks for ms-*.php files.
A few functions can return a conditional instead of an if/else of true/false.

See #32444.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ms-functions.php

    r32381 r32611  
    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 = '' ) {
     
    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 ) {
     
    6569    $blogs = get_blogs_of_user( $user_id );
    6670    if ( empty( $blogs ) )
    67         return null;
     71        return;
    6872
    6973    if ( !is_multisite() )
     
    104108            }
    105109        } else {
    106             return null;
     110            return;
    107111        }
    108112        return $ret;
     
    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 ) {
     
    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 = '') {
     
    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 ) {
     
    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 */
     
    447455 *
    448456 * @since MU
     457 *
     458 * @global wpdb $wpdb
    449459 *
    450460 * @param string $user_name  The login name provided by the user.
     
    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.
     
    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() )  {
     
    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() ) {
     
    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 */
     
    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 */
     
    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) {
     
    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 ) {
     
    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 ) {
     
    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 */
     
    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) {
     
    13281351 * @since MU
    13291352 *
    1330  * @param int $blog_id The value returned by insert_blog().
     1353 * @global wpdb     $wpdb
     1354 * @global WP_Roles $wp_roles
     1355 *
     1356 * @param int    $blog_id    The value returned by insert_blog().
    13311357 * @param string $blog_title The title of the new site.
    13321358 */
     
    13821408 * @deprecated Use wp_install_defaults()
    13831409 *
     1410 * @global wpdb $wpdb
     1411 *
    13841412 * @param int $blog_id Ignored in this function.
    13851413 * @param int $user_id
     
    14071435 * @since MU
    14081436 *
    1409  * @param int $blog_id
    1410  * @param int $user_id
     1437 * @param int    $blog_id
     1438 * @param int    $user_id
    14111439 * @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.
     1440 * @param string $title    The new blog's title
     1441 * @param array  $meta    Optional. Not used in the default function, but is passed along to hooks for customization.
    14141442 * @return bool
    14151443 */
     
    15101538 * @since MU
    15111539 *
    1512  * @param int $user_id
     1540 * @param int    $user_id
    15131541 * @param string $password
    1514  * @param array $meta Optional. Not used in the default function, but is passed along to hooks for customization.
     1542 * @param array  $meta    Optional. Not used in the default function, but is passed along to hooks for customization.
    15151543 * @return bool
    15161544 */
     
    15881616 * @since MU
    15891617 *
     1618 * @global object $current_site
     1619 *
    15901620 * @return object
    15911621 */
     
    16021632 *
    16031633 * @since MU
     1634 *
     1635 * @global wpdb $wpdb
    16041636 *
    16051637 * @param int $user_id
     
    16751707 *
    16761708 * @param string $directory
    1677  * @return int
     1709 * @return int|false
    16781710 */
    16791711function recurse_dirsize( $directory ) {
     
    17381770 *
    17391771 * @since MU
     1772 *
     1773 * @global wpdb $wpdb
    17401774 */
    17411775function update_posts_count( $deprecated = '' ) {
     
    17481782 *
    17491783 * @since MU
     1784 *
     1785 * @global wpdb $wpdb
    17501786 *
    17511787 * @param int $blog_id
     
    17651801 *
    17661802 * @see term_id_filter
     1803 *
     1804 * @global wpdb $wpdb
     1805 * @staticvar int $global_terms_recurse
    17671806 *
    17681807 * @param int $term_id An ID for a term on the current blog.
     
    18471886 *
    18481887 * @param array $upload
    1849  * @return mixed If the upload is under the size limit, $upload is returned. Otherwise returns an error message.
     1888 * @return string|array If the upload is under the size limit, $upload is returned. Otherwise returns an error message.
    18501889 */
    18511890function upload_is_file_too_big( $upload ) {
    1852     if ( is_array( $upload ) == false || defined( 'WP_IMPORTING' ) || get_site_option( 'upload_space_check_disabled' ) )
     1891    if ( ! is_array( $upload ) || defined( 'WP_IMPORTING' ) || get_site_option( 'upload_space_check_disabled' ) )
    18531892        return $upload;
    18541893
     
    19221961function maybe_add_existing_user_to_blog() {
    19231962    if ( false === strpos( $_SERVER[ 'REQUEST_URI' ], '/newbloguser/' ) )
    1924         return false;
     1963        return;
    19251964
    19261965    $parts = explode( '/', $_SERVER[ 'REQUEST_URI' ] );
     
    19451984 * @since MU
    19461985 *
     1986 * @global int $blog_id
     1987 *
    19471988 * @param array $details
     1989 * @return true|WP_Error|void
    19481990 */
    19491991function add_existing_user_to_blog( $details = false ) {
     
    19612003         */
    19622004        do_action( 'added_existing_user', $details['user_id'], $result );
    1963     }
    1964     return $result;
     2005        return $result;
     2006    }
    19652007}
    19662008
     
    19742016 * @see add_user_to_blog()
    19752017 *
    1976  * @param int $user_id
     2018 * @param int   $user_id
    19772019 * @param mixed $password Ignored.
    19782020 * @param array $meta
     
    20032045 *
    20042046 * @param string|WP_User $user Optional. Defaults to current user. WP_User object,
    2005  *  or user login name as a string.
     2047 *                             or user login name as a string.
    20062048 * @return bool
    20072049 */
     
    20262068 *
    20272069 * @param int $old_value
    2028  * @param int $value The new public value
     2070 * @param int $value     The new public value
    20292071 */
    20302072function update_blog_public( $old_value, $value ) {
     
    20372079 * @since MU
    20382080 *
     2081 * @global wpdb $wpdb
     2082 *
    20392083 * @param string $key
    2040  * @param int $user_id Optional. Defaults to current user.
    2041  * @param int $blog_id Optional. Defaults to current blog.
     2084 * @param int    $user_id Optional. Defaults to current user.
     2085 * @param int    $blog_id Optional. Defaults to current blog.
    20422086 * @return bool
    20432087 */
     
    20512095    $local_key = $wpdb->get_blog_prefix( $blog_id ) . $key;
    20522096
    2053     if ( isset( $current_user->$local_key ) )
    2054         return true;
    2055 
    2056     return false;
     2097    return isset( $current_user->$local_key );
    20572098}
    20582099
     
    20662107function users_can_register_signup_filter() {
    20672108    $registration = get_site_option('registration');
    2068     if ( $registration == 'all' || $registration == 'user' )
    2069         return true;
    2070 
    2071     return false;
     2109    return ( $registration == 'all' || $registration == 'user' );
    20722110}
    20732111
     
    21062144 *
    21072145 * @since 2.8.5
     2146 *
     2147 * @staticvar bool $forced_content
    21082148 *
    21092149 * @param string|bool $force
     
    22142254 *
    22152255 * @since 3.7.0
     2256 *
     2257 * @global wpdb $wpdb
    22162258 */
    22172259function wp_update_network_site_counts() {
     
    22262268 *
    22272269 * @since 3.7.0
     2270 *
     2271 * @global wpdb $wpdb
    22282272 */
    22292273function wp_update_network_user_counts() {
     
    23652409 *
    23662410 * @since 3.7.0
     2411 *
     2412 * @global wpdb $wpdb
    23672413 *
    23682414 * @param array $args {
Note: See TracChangeset for help on using the changeset viewer.