Role | Assign Tags | Create | Modify | Delete |
---|---|---|---|---|
Contributor | Y | Y | N | N |
Author | Y | Y | N | N |
Editor | Y | Y | Y | Y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Transform 'tag=' (which expects slug) to 'tag_id=' in rewrite rules. | |
*/ | |
add_filter( 'post_tag_rewrite_rules', function( $rewrite_rules ) { | |
$processed_rules = array(); | |
foreach ( $rewrite_rules as $match => $query ) { | |
$processed_rules[ $match ] = str_replace( 'tag=', 'tag_id=', $query ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Update a specific site from 'http://' to 'https://'. | |
* | |
* Only touches the 'home' and 'siteurl' options. | |
* Depending on plugins, etc., you may need to update other options too. | |
* | |
* Run on WordPress multisite with: | |
* | |
* wp site list --field=url | xargs -I % wp eval-file http-to-https.php --url=% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Strips out unnecessary testsuites data from PHPUnit test results | |
* | |
* Run with `wp eval-file cleanup-results-key.php` | |
*/ | |
global $wpdb; | |
$post_ids = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} WHERE post_type='result'" ); | |
foreach( $post_ids as $h => $post_id ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
list( $log_file ) = $args; | |
if ( ! is_file( $log_file ) ) { | |
WP_CLI::error( 'Invalid log file.' ); | |
} | |
$contents = file_get_contents( $log_file ); | |
$bits = explode( 'Running: plugin install', $contents ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugin | classic_percent_diff | gutenberg_percent_diff | gallery_link | |
---|---|---|---|---|
contact-form-7 | 0% | 0% | http://gutensnaps.handbuilt.co/index.php?plugin_name=contact-form-7 | |
wordpress-seo | 2.923% | 0.82% | http://gutensnaps.handbuilt.co/index.php?plugin_name=wordpress-seo | |
akismet | 0% | 0% | http://gutensnaps.handbuilt.co/index.php?plugin_name=akismet | |
jetpack | 0% | 0% | http://gutensnaps.handbuilt.co/index.php?plugin_name=jetpack | |
wordpress-importer | 0% | 0% | http://gutensnaps.handbuilt.co/index.php?plugin_name=wordpress-importer | |
all-in-one-seo-pack | 4.657% | 0.72% | http://gutensnaps.handbuilt.co/index.php?plugin_name=all-in-one-seo-pack | |
google-sitemap-generator | 0% | 0% | http://gutensnaps.handbuilt.co/index.php?plugin_name=google-sitemap-generator | |
limit-login-attempts | 0% | 0% | http://gutensnaps.handbuilt.co/index.php?plugin_name=limit-login-attempts | |
tinymce-advanced | 0.862% | 0% | http://gutensnaps.handbuilt.co/index.php?plugin_name=tinymce-advanced |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Success: Plugin already deactivated. | |
Running: plugin install contact-form-7 | |
Taking before screenshots... | |
Running: plugin activate contact-form-7 | |
Installed and activated Contact Form 7 (4.9.2) | |
-> [Contact Form 7](https://wordpress.org/plugins/contact-form-7/) | |
Taking after screenshots... | |
Running: plugin deactivate contact-form-7 | |
Running: plugin delete contact-form-7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use WP_CLI\Utils; | |
class GutenSnaps { | |
/** | |
* Plugin to test. | |
* | |
* @var string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* After creating the necessary table, run with `wp eval-file plugin-stats.php` | |
*/ | |
use WP_CLI\Utils; | |
global $wpdb; | |
$original_request_url = 'https://wordpress.org/plugins/wp-json/plugins/v1/query-plugins?s=&posts_per_page=100'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Create a byline when a new user is created. | |
* | |
* @see https://bylines.io/docs/create-new-byline-automatically-user/ | |
*/ | |
add_action( 'user_register', function( $user_id ) { | |
\Bylines\Objects\Byline::create_from_user( $user_id ); | |
}); |