WordPress.org

Make WordPress Core

Changeset 30630


Ignore:
Timestamp:
11/30/2014 05:05:36 AM (4 years ago)
Author:
DrewAPicture
Message:

Add missing DocBlocks for several functions in wp-admin/includes/ms.php.

Props dustyf.
See #30483.

File:
1 edited

Legend:

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

    r30404 r30630  
    4545
    4646/**
    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.
    5453 */
    5554function wpmu_delete_blog( $blog_id, $drop = false ) {
     
    170169}
    171170
    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 */
    173181function wpmu_delete_user( $id ) {
    174182    global $wpdb;
     
    226234}
    227235
     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 */
    228244function update_option_new_admin_email( $old_value, $value ) {
    229245    if ( $value == get_option( 'admin_email' ) || !is_email( $value ) )
     
    279295add_action( 'add_option_new_admin_email', 'update_option_new_admin_email', 10, 2 );
    280296
     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 */
    281305function send_confirmation_on_profile_email() {
    282306    global $errors, $wpdb;
     
    349373add_action( 'personal_options_update', 'send_confirmation_on_profile_email' );
    350374
     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 */
    351381function new_user_email_admin_notice() {
    352382    if ( strpos( $_SERVER['PHP_SELF'], 'profile.php' ) && isset( $_GET['updated'] ) && $email = get_option( get_current_user_id() . '_new_email' ) )
     
    361391 *
    362392 * @param bool $echo Optional. If $echo is set and the quota is exceeded, a warning message is echoed. Default is true.
    363  * @return int
     393 * @return bool True if user is over upload space quota, otherwise false.
    364394 */
    365395function upload_is_user_over_quota( $echo = true ) {
     
    423453}
    424454
    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 */
    426462function upload_space_setting( $id ) {
    427463    switch_to_blog( $id );
     
    441477add_action( 'wpmueditblogaction', 'upload_space_setting' );
    442478
     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 */
    443493function update_user_status( $id, $pref, $value, $deprecated = null ) {
    444494    global $wpdb;
     
    477527}
    478528
     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 */
    479537function refresh_user_details( $id ) {
    480538    $id = (int) $id;
     
    488546}
    489547
     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 */
    490557function format_code_lang( $code = '' ) {
    491558    $code = strtolower( substr( $code, 0, 2 ) );
     
    515582}
    516583
     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 */
    517596function sync_category_tag_slugs( $term, $taxonomy ) {
    518597    if ( global_terms_enabled() && ( $taxonomy == 'category' || $taxonomy == 'post_tag' ) ) {
     
    527606add_filter( 'get_term', 'sync_category_tag_slugs', 10, 2 );
    528607
     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 */
    529615function _access_denied_splash() {
    530616    if ( ! is_user_logged_in() || is_network_admin() )
     
    561647add_action( 'admin_page_access_denied', '_access_denied_splash', 99 );
    562648
     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 */
    563657function check_import_new_users( $permission ) {
    564658    if ( !is_super_admin() )
     
    569663// See "import_allow_fetch_attachments" and "import_attachment_size_limit" filters too.
    570664
     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 */
    571673function mu_dropdown_languages( $lang_files = array(), $current = '' ) {
    572674    $flag = false;
     
    596698    // Order by name
    597699    uksort( $output, 'strnatcasecmp' );
     700
    598701    /**
    599702     * Filter the languages available in the dropdown.
     
    606709     */
    607710    $output = apply_filters( 'mu_dropdown_languages', $output, $lang_files, $current );
     711
    608712    echo implode( "\n\t", $output );
    609713}
    610714
     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 */
    611722function site_admin_notice() {
    612723    global $wp_db_version;
     
    619730add_action( 'network_admin_notices', 'site_admin_notice' );
    620731
     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 */
    621744function avoid_blog_page_permalink_collision( $data, $postarr ) {
    622745    if ( is_subdomain_install() )
     
    642765add_filter( 'wp_insert_post_data', 'avoid_blog_page_permalink_collision', 10, 2 );
    643766
     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 */
    644775function choose_primary_blog() {
    645776    ?>
     
    697828 *
    698829 * @since 3.0.0
     830 *
    699831 * @param int $user_id ID of the user to be granted Super Admin privileges.
    700832 * @return bool True on success, false on failure. This can fail when the user is
    701  *              already a super admin or when the $super_admins global is defined.
     833 *              already a super admin or when the `$super_admins` global is defined.
    702834 */
    703835function grant_super_admin( $user_id ) {
     
    741873 *
    742874 * @since 3.0.0
     875 *
    743876 * @param int $user_id ID of the user Super Admin privileges to be revoked from.
    744877 * @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_admins global is defined.
     878 *              is the network admin email or when the `$super_admins` global is defined.
    746879 */
    747880function revoke_super_admin( $user_id ) {
     
    784917
    785918/**
    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.
    789923 *
    790924 * @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.
    792928 */
    793929function can_edit_network( $site_id ) {
     
    814950 *
    815951 * @since 3.1.0
     952 *
    816953 * @access private
    817954 */
Note: See TracChangeset for help on using the changeset viewer.