How do I deactivate widgets by name?
Try using the –fields and –format parameter, e.g. wp widget list sidebar-1 –fields=id –format=json Docs: WP-CLI Commands wp widget list
Try using the –fields and –format parameter, e.g. wp widget list sidebar-1 –fields=id –format=json Docs: WP-CLI Commands wp widget list
Depends on what you want to do. If you want to run the PHP code that’s behind the WP-CLI code you might consider looking at https://github.com/wp-cli/entity-command Maybe you don’t actually need WP-CLI but the corresponding code behind it. Most WP-CLI commands have WordPress equivalents. For example of what I was trying to do today, the … Read more
Generally, MAMP is not installed in a place that wp-cli expect it to be installed. And the MySQL socket file is needed to by the application. Creating a symbolic link would help. Locate the socket file location either in tmp or var netstat -a | grep mysql In the case of MAC Sierra and MAMP … Read more
The correct approach is to use HTTPS everywhere, and to migrate to SSL properly: remove the Really Simple SSL plugin change your sites URL option to the https version search replace your database so all content uses the https URL via WP CLI or a search replace tool ( do not use an SQL query … Read more
I figured it out, with some help. You have to be on the same server where the files are located to use wp media import. The steps are: Log out of ssh connection Log into the remote server using sftp Upload the files using sftp, then log out Log back in using ssh Then you … Read more
The function wp_cache_flush() should help you but is not the same one. The function runs on the global $wp_object_cache and set a new empty array, different to the WP CLI deprecated function wp_clear_object_cache for different keys of the global var. function wp_clear_object_cache() { global $wpdb, $wp_object_cache; $wpdb->queries = []; if ( ! is_object( $wp_object_cache ) … Read more
From wp-cli.org: Type “exit” to close session. Alternatively you can try hitting Ctrl+C or Cmd+C for Mac I think.
Currently it is not available in WP CLI. See https://github.com/wp-cli/wp-cli/blob/master/php/commands/comment.php#L136 If you want, you can have your own customized comment generation command. See command cookbook. http://wp-cli.org/docs/commands-cookbook/
You would need to define the global URL parameter in wp-cli.yml or in the command like –url=https://example.com
The list of fields is available on the wp post list page. These fields will be displayed by default for each post: ID post_title post_name post_date post_status These fields are optionally available: post_author post_date_gmt post_content post_excerpt comment_status ping_status post_password to_ping pinged post_modified post_modified_gmt post_content_filtered post_parent guid menu_order post_type post_mime_type comment_count filter url