Last active
August 29, 2015 14:20
-
-
Save Critter/a8f8ba78a1165420e8a5 to your computer and use it in GitHub Desktop.
prevent posting to Wordpress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'wp_insert_post_data', 'post_publish_filter_wpse_82356' ); | |
function post_publish_filter_wpse_82356( $data ) { | |
// view/manipulate $data | |
// we still need to be able to post pages and products so just kill off attempted posts | |
if ('publish' == $data['post_status'] && 'post' == $data['post_type']) { | |
$msg = '<pre>' . var_export($data, true) . '</pre>'; | |
wp_die($msg); | |
} | |
return $data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment