I am trying to utilize WP_Error for my plugin, but nothing happens. Is this too late for WP_Error? Too early? Or am I doing something else wrong?
function cpt_pre_post_publish(){
return new WP_Error('error', __('Error!' ));
}
add_action('pre_get_posts', 'cpt_pre_post_publish');
return
ing theWP_Error
. Do you try to display it somewhere else?