Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
AcmeSavePost - For a comment on Tom McFarlin's blog
<?php
class AcmeSavePost {
public function __construct() {
add_action( 'save_post', array( $this, 'modify_post_content' ) );
}
public function modify_post_content( $post_id ) {
static $recursing = false;
if ( ! $recursing ) {
$recursing = true;
$post = array(
'ID' => $post_id,
'content' => ''
);
wp_update_post( $post );
$recursing = false;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment