Skip to content

Instantly share code, notes, and snippets.

@trepmal
Forked from anonymous/post stuff
Created December 11, 2012 00:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trepmal/4254802 to your computer and use it in GitHub Desktop.
Save trepmal/4254802 to your computer and use it in GitHub Desktop.
WordPress post action
add_action( 'edit_post', 'json_dump', 10, 2 );
function json_dump( $post_id, $post ) {
$posttype = get_post_type( $post );
// http://codex.wordpress.org/WordPress_Coding_Standards#Yoda_Conditions
if ( 'tree' == $posttype ) {
exec('/home/fufnet/treeupdater > log.txt');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment