Skip to content

Instantly share code, notes, and snippets.

Created March 16, 2013 00:01
Show Gist options
  • Save anonymous/5174173 to your computer and use it in GitHub Desktop.
Save anonymous/5174173 to your computer and use it in GitHub Desktop.
add_action( 'save_post', 'tiny_change_author' );
function tiny_change_author( $post_id ) {
if ( !wp_is_post_revision( $post_id ) ) {
remove_action('save_post', 'tiny_change_author');
wp_update_post(array('ID' => $post_id, 'post_author' => 1));
add_action('save_post', 'tiny_change_author');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment