PluginProbe
Elementor Website Builder – more than just a page builder / 3.1.2
Elementor Website Builder – more than just a page builder v3.1.2
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | modules/wp-cli/command.php +11 -1 3.1.13.1.2 View file →
@@ -77,13 +77,19 @@
77 77
78 78 /**
79 79 * Replace old URLs with new URLs in all Elementor pages.
80 80 *
81 + * [--force]
82 + * Suppress error messages. instead, return "0 affected rows.".
83 + *
81 84 * ## EXAMPLES
82 85 *
83 86 * 1. wp elementor replace-urls <old> <new>
84 87 * - This will replace all <old> URLs with the <new> URL.
85 88 *
89 + * 2. wp elementor replace-urls <old> <new> --force
90 + * - This will replace all <old> URLs with the <new> URL without throw errors.
91 + *
86 92 * @access public
87 93 * @alias replace-urls
88 94 */
89 95 public function replace_urls( $args, $assoc_args ) {
@@ -98,9 +104,13 @@
98 104 try {
99 105 $results = Utils::replace_urls( $args[0], $args[1] );
100 106 \WP_CLI::success( $results );
101 107 } catch ( \Exception $e ) {
102 - \WP_CLI::error( $e->getMessage() );
108 + if ( isset( $assoc_args['force'] ) ) {
109 + \WP_CLI::success( '0 rows affected.' );
110 + } else {
111 + \WP_CLI::error( $e->getMessage() );
112 + }
103 113 }
104 114 }
105 115
106 116 /**