ACF_Admin_Internal_Post_Type_List::display_post_states
Adds the "disabled" post state for the admin table title.
Метод класса: ACF_Admin_Internal_Post_Type_List{}
Хуков нет.
Возвращает
Массив.
Использование
$ACF_Admin_Internal_Post_Type_List = new ACF_Admin_Internal_Post_Type_List(); $ACF_Admin_Internal_Post_Type_List->display_post_states( $post_states, $post );
- $post_states(массив) (обязательный)
- An array of post display states.
- $post(WP_Post) (обязательный)
- The current post object.
Список изменений
| С версии 5.9.0 | Введена. |
Код ACF_Admin_Internal_Post_Type_List::display_post_states() ACF Admin Internal Post Type List::display post states ACF 6.4.2
public function display_post_states( $post_states, $post ) {
if ( $post->post_status === 'acf-disabled' ) {
$post_states['acf-disabled'] = $this->get_disabled_post_state();
}
// Check the post store to see if this failed registration.
if ( ! empty( $this->store ) && ! empty( $post->ID ) ) {
$store = acf_get_store( $this->store );
if ( $store ) {
$store_item = $store->get( $post->ID );
if ( ! empty( $store_item ) && ! empty( $store_item['not_registered'] ) ) {
$post_states['acf-registration-warning'] = $this->get_registration_error_state();
}
}
}
return $post_states;
}