wpce_edit_screen_error v3.20
Filters the error message in the post edit screen.
If an error message is returned from this filter, the WPCE editor will not be shown and the error message will be displayed instead.
Parameters
?string $edit_screen_errorThe error message to show.
nullif no error occured.WP_Post $postThe post that should be edited.
Example
php
add_filter('wpce_edit_screen_error', function (?string $edit_screen_error, WP_Post $post) {
if ($post->post_author !== get_current_user_id()) {
return 'You can only edit your own posts.';
}
return $edit_screen_error;
}, 10, 2);