| @@ 21-29 (lines=9) @@ | ||
| 18 | * wp videopress import kUJmAcSf | |
| 19 | * | |
| 20 | */ | |
| 21 | 		public function import( $args ) { | |
| 22 | $guid = $args[0]; | |
| 23 | $attachment_id = create_local_media_library_for_videopress_guid( $guid ); | |
| 24 | 			if ( $attachment_id && ! is_wp_error( $attachment_id ) ) { | |
| 25 | WP_CLI::success( sprintf( __( 'The video has been imported as Attachment ID %d', 'jetpack' ), $attachment_id ) ); | |
| 26 | 			} else { | |
| 27 | WP_CLI::error( __( 'An error has been encountered.', 'jetpack' ) ); | |
| 28 | } | |
| 29 | } | |
| 30 | ||
| 31 | /** | |
| 32 | * Manually runs the job to cleanup videos from the media library that failed during the upload process. | |
| @@ 193-201 (lines=9) @@ | ||
| 190 | * wp videopress import kUJmAcSf | |
| 191 | * | |
| 192 | */ | |
| 193 | 		public function import( $args ) { | |
| 194 | $guid = $args[0]; | |
| 195 | $attachment_id = create_local_media_library_for_videopress_guid( $guid ); | |
| 196 | 			if ( $attachment_id && ! is_wp_error( $attachment_id ) ) { | |
| 197 | WP_CLI::success( sprintf( __( 'The video has been imported as Attachment ID %d', 'jetpack' ), $attachment_id ) ); | |
| 198 | 			} else { | |
| 199 | WP_CLI::error( __( 'An error has been encountered.', 'jetpack' ) ); | |
| 200 | } | |
| 201 | } | |
| 202 | } | |
| 203 | WP_CLI::add_command( 'videopress', 'VideoPress_CLI' ); | |
| 204 | } | |