function rfi_should_let_post_publish($post) { $has_featured_image = has_post_thumbnail($post->ID); $is_watched_post_type = in_array($post->post_type, rfi_return_post_types()); $is_after_enforcement_time = strtotime($post->post_date) > rfi_enforcement_start_time(); if ($is_after_enforcement_time && $is_watched_post_type) { return $has_featured_image; } return true; }
function rfi_post_types_input_renderer() { $option = rfi_return_post_types(); $post_types = rfi_return_post_types_which_support_featured_images(); foreach ($post_types as $type => $obj) { if (in_array($type, $option)) { echo '<input type="checkbox" name="rfi_post_types[]" value="' . $type . '" checked="checked">' . $obj->label . '<br>'; } else { echo '<input type="checkbox" name="rfi_post_types[]" value="' . $type . '">' . $obj->label . '<br>'; } } }
function rfi_should_let_id_publish($post) { return !(in_array($post->post_type, rfi_return_post_types()) && !has_post_thumbnail($post->ID)); }