hide_menu_item(); $this->redirect(); } public function hide_menu_item() { // Remove the ACF main item from the admin menu. add_filter( 'acf/settings/show_admin', '__return_false' ); } public function redirect() { // If the user tries to access an ACF page directly, redirect them to the Dashboard. if ( isset( $_GET['post_type'] ) && $_GET['post_type'] === 'acf-field-group' ) { wp_redirect( admin_url() ); die(); } } } new ACF_Hider();