WPSEO_Slug_Change_Watcher::is_post_viewable
Checks if the post is viewable.
Метод класса: WPSEO_Slug_Change_Watcher{}
Хуков нет.
Возвращает
true|false. Whether the post is viewable or not.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->is_post_viewable( $post_id );
- $post_id(строка) (обязательный)
- The post id to check.
Код WPSEO_Slug_Change_Watcher::is_post_viewable() WPSEO Slug Change Watcher::is post viewable Yoast 26.5
protected function is_post_viewable( $post_id ) {
$post_type = get_post_type( $post_id );
if ( ! WPSEO_Post_Type::is_post_type_accessible( $post_type ) ) {
return false;
}
$post_status = get_post_status( $post_id );
if ( ! $this->check_visible_post_status( $post_status ) ) {
return false;
}
return true;
}