Skip to content

Instantly share code, notes, and snippets.

@vyskoczilova
Last active January 30, 2019 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vyskoczilova/8e689123c85a442d26c56b50ef503549 to your computer and use it in GitHub Desktop.
Save vyskoczilova/8e689123c85a442d26c56b50ef503549 to your computer and use it in GitHub Desktop.
Add ACF settings page under selected menu item
<?php // ommit this line
/**
* @snippet Add ACF Pro settings page under a menu item of your choice
* @comment In case you'd like to add your option page to the CPT, under posts or whatever location you'd like
* @source https://kybernaut.cz/clanky/wp-multisite-maximalni-velikost-nahravaneho-souboru/
* @author Karolína Vyskočilová (https://kybernaut.cz)
* @testedwith WordPress 5.0.5
*/
// -------------------
if( function_exists('acf_add_options_sub_page') ) {
// add sub page
acf_add_options_sub_page(array(
'page_title' => 'Title of your custom option page',
'menu_title' => 'Menu title',
'parent' => 'edit.php?post_type=YOUR-CPT-GOES-HERE', // works as normal parent_slug from https://developer.wordpress.org/reference/functions/add_submenu_page/
'capability' => 'manage_options'
));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment