current_screen
最后更新于:2021-11-26 04:02:57
do_action( ‘current_screen’, GC_Screen $current_screen )
Fires after the current screen has been set.
参数
源文件
文件: gc-admin/includes/class-gc-screen.php
/** * Hides out the desired sidebar area from the widgets admin page. * * @param GC_Screen $current_screen Current GC_Screen object. * @return void. */ function prefix_hide_sidebar( $current_screen ) { global $gc_registered_sidebars; $sidebar_id = 'sidebar-1'; if ( 'widgets' === $current_screen->id ) { if ( array_key_exists( $sidebar_id, $gc_registered_sidebars ) ) { unset( $gc_registered_sidebars[ $sidebar_id ] ); } } } add_action( 'current_screen', 'prefix_hide_sidebar', 10, 1 );