Check checkbox of post expirator if post is set to specific category
-
Hi,
we would like to run the post expirator plugin only if the post category is set to a specific category.
I am currently looking at a piece of code which fires on the save post hook, but I would need to know where the checkbox value is typically stored in the mysql database for this to work.
could you help me with this please ?
I have currently this, but it won’t work so I need to alter it to look at the meta value created by the plugin
function expire( $post_id ) if (has_category('39',$post->ID)) { $( "#enable-expirationdate").prop('checked', true); } else { $( "#enable-expirationdate").prop('checked', false); } add_action( 'save_post', 'expire' );
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Check checkbox of post expirator if post is set to specific category’ is closed to new replies.