Yoast\WP\SEO\Abilities\Infrastructure
Post_Access_Checker::forbidden_error
Builds the 403 error for posts the current user may not edit.
Mirrors WP core's rest_cannot_edit wording.
Метод класса: Post_Access_Checker{}
Хуков нет.
Возвращает
WP_Error. The forbidden error.
Использование
$Post_Access_Checker = new Post_Access_Checker(); $Post_Access_Checker->forbidden_error(): WP_Error;
Код Post_Access_Checker::forbidden_error() Post Access Checker::forbidden error Yoast 28.3
public function forbidden_error(): WP_Error {
return new WP_Error(
'yoast_seo_cannot_edit_post',
\__( 'Sorry, you are not allowed to edit this post.', 'wordpress-seo' ),
[ 'status' => 403 ],
);
}