Automattic / Co-Authors-Plus

Multiple bylines and Guest Authors for WordPress
https://wordpress.org/plugins/co-authors-plus/
GNU General Public License v2.0
290 stars 205 forks source link

CLI Command to Flush Author Cache #929

Open BrookeDot opened 1 year ago

BrookeDot commented 1 year ago

The cache key for guest authors is an md5 hash generated with get_cache_key https://github.com/Automattic/Co-Authors-Plus/blob/f332122a5b56b461ad90969e2a14600e649a2e9a/php/class-coauthors-guest-authors.php#L1124-L1145

This cache key is passed to delete_guest_author_cache.

Right now one way to delete author cache is with WP Shell and wp_cache_delete ie:

wp_cache_delete( md5( 'guest-author-user_nicename-cap-USER-NICENAME' ), 'coauthors-plus-guest-authors' );

It would be great if delete_guest_author_cache() could be accessible via a WP-CLI subcommand.