Deleting post if field is empty
-
All the posts I make have custom fields attached to it. I also made it so I can publish empty posts. I want to make a line of code when I create a post it checks to see if a certain custom field is empty if it is delete it if it isn’t publish it. I have this so far.
function force_type_private($post) { $post['post_status'] = 'publish'; return $post; } add_filter('wp_insert_post_data', 'force_type_private');
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Deleting post if field is empty’ is closed to new replies.