Support

Account

Home Forums ACF PRO Remoce ACF option page menu item

Solved

Remoce ACF option page menu item

  • I am using ACF 5 PRO, tried everything like

    function my_remove_menu_pages() {
           remove_menu_page('tools.php'); 
            remove_menu_page('profile.php');    
    	remove_menu_page('acf-options');     
     // I have tried all possible slugs
        }

    but cant remove Options Page from menu items which can be created by ACF.
    Basically i want to remove the options page for anyone else except admin.
    Any ideas?

  • What about adding it only for admins? Would that solve your problem?

    if ( function_exists('acf_add_options_page') ) {
    	if ( current_user_can( 'administrator' ) ) {
    		acf_add_options_page();	// or similar
    	}
    }
  • Thats what I had to do, but I wonder why the remove menu options not wokring only with ACF. I am not a pro, but there has to be a way to do it.

    Thanks

  • You could also try to use a higher priority for your action. The documentation says, the options page entry is added with priority 99, so you could try e.g. 100:

    add_action( 'admin_menu', 'my_remove_menu_pages', 100 );
    
Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Remoce ACF option page menu item’ is closed to new replies.