Yoast\WP\SEO\Bulk_Editor\Infrastructure\Posts
Post_Editability_Resolver::resolve
Returns, for each given post ID, whether the current user may edit it.
Метод класса: Post_Editability_Resolver{}
Хуков нет.
Возвращает
Массив
Использование
$Post_Editability_Resolver = new Post_Editability_Resolver(); $Post_Editability_Resolver->resolve( $post_ids ): array;
- $post_ids(array
) (обязательный) - The post IDs on the current page.
Код Post_Editability_Resolver::resolve() Post Editability Resolver::resolve Yoast 28.3
public function resolve( array $post_ids ): array {
if ( $post_ids === [] ) {
return [];
}
// Prime the post cache once so the per-post edit check does not run a query per post.
\_prime_post_caches( $post_ids, false, false );
$editability = [];
foreach ( $post_ids as $post_id ) {
$editability[ $post_id ] = $this->post_access_checker->can_edit( $post_id );
}
return $editability;
}