Skip to content

Instantly share code, notes, and snippets.

@alpha1
Last active March 22, 2018 19:19
Show Gist options
  • Save alpha1/337fe25eecbfee8a4202ca5639c95e9f to your computer and use it in GitHub Desktop.
Save alpha1/337fe25eecbfee8a4202ca5639c95e9f to your computer and use it in GitHub Desktop.
Co-Authors-Plus: Delete All GuestAuthors
<?php
function delete_all_coauthors(){
global $coauthors_plus;
$coauths = get_posts( array( 'post_type' => 'guest-author', 'posts_per_page' => -1, 'post_status' => 'any' ) );
foreach( $coauths as $coauth){
$coauthors_plus->guest_authors->delete( $coauth->ID, false );
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment