disable publish button until condition is not met
I finally found somethings. Not directly by cod it but I find a already wrote plugins for this. http://wordpress.org/plugins/force-post-category-selection/ Hope it’s will help others wordpress user.
I finally found somethings. Not directly by cod it but I find a already wrote plugins for this. http://wordpress.org/plugins/force-post-category-selection/ Hope it’s will help others wordpress user.
You can make use of dynamic hook do_action( “{$old_status}_to_{$new_status}”, $post ); in wp_transition_post_status() to target exact combination. So in your case it would be something like draft_to_publish. I am not sure why exactly your attempt is failing though, without thoroughly debugging it.
The publish_page action is listed as deprecated. You can use the ‘transition_post_status’ hook to check if a page was published. function publish_page_interception( $new_status, $old_status, $post ) { if ( ($new_status != $old_status) && ($post->post_status == ‘publish’) && ($post->post_type == ‘page’) ) { if($post->post_parent > 0) { //do stuff } } } add_action( ‘transition_post_status’, ‘publish_page_interception’, 10, … Read more
Since the server side languages differ in both, you can not do such conversion in a straightforward manner or via any tool, easily. The site that you have created in VS runs over .Net framework and written in .Net languages while the WordPress is in PHP. The HTML,CSS,JS etc browser specific things you may be … Read more
WordPress Author Posts Review After Every Change In The Same WordPress Post
Send Custom Post Notification to Followers
My page won’t publish
Wrap it in a function and hook it to transition_post_status: function wpse_18140_transition_post_status( $new, $old, $post ) { if ( $new === ‘publish’ && $new !== $old ) { // Your code here } } add_action( ‘transition_post_status’, ‘wpse_18140_transition_post_status’, 10, 3 ); This will run everytime a post is published, but not when you simply update the … Read more
How can I get taxonomy terms and custom field values of a newly created post
I ended up going with this type of solution. It seems to be working fine for me. I am open on ways to improve this code as it seems there is a better hook that could be used. function on_music_publish( $post_ID, $post ) { if ( $post->post_type != ‘music’ ) { return; } update_post_meta($post_ID, ‘_disable_fbc’, … Read more