Changeset 10279
- Timestamp:
- 09/21/2020 07:43:13 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/cli-commands.php
r8040 r10279 18 18 * an active install. 19 19 * 20 * <user-id>21 * : ID of user to attribute all parsed posts to. 20 * [--user_id=<user_id>] 21 * : ID of user to attribute all parsed posts to. Default is 5911429, the ID for wordpressdotorg. 22 22 * 23 23 * ## EXAMPLES 24 24 * 25 25 * # Parse WP 4.9.5 into DevHub. 26 * $ wp devhub /home/wporgdev/developer/wp495 360626 * $ wp devhub /home/wporgdev/developer/wp495 27 27 * 28 28 * @when after_wp_load 29 29 */ 30 30 public function parse( $args, $assoc_args ) { 31 list( $path , $user_id) = $args;31 list( $path ) = $args; 32 32 33 if ( ! is_numeric( $user_id ) ) { 34 WP_CLI::error( 'Invalid user_id provided.' ); 35 } else { 36 $user_id = (int) $user_id; 37 } 33 $user_id = $assoc_args['user_id'] ?? 5911429; // 5911429 = ID for wordpressdotorg 38 34 $user = get_user_by( 'id', $user_id ); 39 35 if ( ! $user ) {
Note: See TracChangeset
for help on using the changeset viewer.