ACF_Admin_Field_Groups::current_screen()
Constructor for the Field Groups admin page.
Метод класса: ACF_Admin_Field_Groups{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$ACF_Admin_Field_Groups = new ACF_Admin_Field_Groups(); $ACF_Admin_Field_Groups->current_screen();
Список изменений
С версии 5.0.0 | Введена. |
Код ACF_Admin_Field_Groups::current_screen() ACF Admin Field Groups::current screen ACF 6.0.4
public function current_screen() { // Bail early if not Field Groups admin page. if ( ! acf_is_screen( 'edit-acf-field-group' ) ) { return; } // Get the current view. $this->view = isset( $_GET['post_status'] ) ? sanitize_text_field( $_GET['post_status'] ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended // 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-acf-field-group', array( $this, 'admin_table_views' ), 10, 1 ); add_filter( 'manage_acf-field-group_posts_columns', array( $this, 'admin_table_columns' ), 10, 1 ); add_action( 'manage_acf-field-group_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-acf-field-group', 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 ); } }