ACF_Admin_Internal_Post_Type_List::current_screen
Constructor for all ACF internal post type admin list pages.
Метод класса: ACF_Admin_Internal_Post_Type_List{}
Хуки из метода
Возвращает
null. Ничего (null).
Использование
$ACF_Admin_Internal_Post_Type_List = new ACF_Admin_Internal_Post_Type_List(); $ACF_Admin_Internal_Post_Type_List->current_screen();
Список изменений
| С версии 5.0.0 | Введена. |
Код ACF_Admin_Internal_Post_Type_List::current_screen() ACF Admin Internal Post Type List::current screen ACF 6.4.2
public function current_screen() {
// Bail early if not the list admin page.
if ( ! acf_is_screen( "edit-{$this->post_type}" ) ) {
return;
}
// Get the current view.
$this->view = acf_request_arg( 'post_status', '' );
// Setup and check for custom actions.
$this->setup_sync();
$this->check_sync();
$this->check_duplicate();
$this->check_activate();
$this->check_deactivate();
// Modify publish post status text and order.
global $wp_post_statuses;
$wp_post_statuses['publish']->label_count = _n_noop( 'Active <span class="count">(%s)</span>', 'Active <span class="count">(%s)</span>', 'acf' );
$wp_post_statuses['trash'] = acf_extract_var( $wp_post_statuses, 'trash' );
// Add hooks.
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
add_action( 'admin_body_class', array( $this, 'admin_body_class' ) );
add_filter( "views_edit-{$this->post_type}", array( $this, 'admin_table_views' ), 10, 1 );
add_filter( "manage_{$this->post_type}_posts_columns", array( $this, 'admin_table_columns' ), 10, 1 );
add_action( "manage_{$this->post_type}_posts_custom_column", array( $this, 'admin_table_columns_html' ), 10, 2 );
add_filter( 'display_post_states', array( $this, 'display_post_states' ), 10, 2 );
add_filter( "bulk_actions-edit-{$this->post_type}", array( $this, 'admin_table_bulk_actions' ), 10, 1 );
add_action( 'admin_footer', array( $this, 'admin_footer' ), 1 );
if ( $this->view !== 'trash' ) {
add_filter( 'page_row_actions', array( $this, 'page_row_actions' ), 10, 2 );
}
// Add hooks for "sync" view.
if ( $this->view === 'sync' ) {
add_action( 'admin_footer', array( $this, 'admin_footer__sync' ), 1 );
}
do_action( 'acf/internal_post_type_list/current_screen', $this->post_type );
}