Making WordPress.org

Changeset 8040


Ignore:
Timestamp:
01/07/2019 11:53:45 PM (5 years ago)
Author:
coffee2code
Message:

Developer, CLI: Report user_nicename alongside ID for user associated with import, to ensure proper user ID was supplied.

Also verify that user exists.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/cli-commands.php

    r7718 r8040  
    3636            $user_id = (int) $user_id;
    3737        }
    38         WP_CLI::log( "Importing as user ID $user_id" );
     38        $user = get_user_by( 'id', $user_id );
     39        if ( ! $user ) {
     40            WP_CLI::error( 'Invalid user_id provided.' );
     41        }
     42        WP_CLI::log( "Importing as user ID $user_id ({$user->user_nicename})." );
    3943
    4044        $plugins = [
Note: See TracChangeset for help on using the changeset viewer.