The check is invoked after a call to get_option( 'wypiekacz_allow_skip_rules' )
.
When you filter pre_option_wypiekacz_allow_skip_rules
and returns something different than FALSE
, it should stop the check early. Not tested.
add_filter(
'pre_option_wypiekacz_allow_skip_rules',
'wpse_100503_wypiekacz_for_drafts_only'
);
function wpse_100503_wypiekacz_for_drafts_only( $bool )
{
if ( 'draft' === get_post_status( $GLOBALS['post'] ) )
return $bool;
return 0;
}
To prevent the post status reset, something like this could work:
add_filter(
'wypiekacz_check_post',
'wpse_100503_wypiekacz_prevent_draft_reset',
10,
4
);
function wpse_100503_wypiekacz_prevent_draft_reset( $errors, $text, $title, $post_data )
{
if ( empty ( $errors ) )
return $errors;
if ( 'pending' === $post_data->post_status )
remove_filter( 'query', array( $GLOBALS['wp_wypiekacz'], 'kill_sql_query' ) );
}
But, honestly, the plugin code is a mess.