Last active
October 29, 2025 00:08
-
-
Save apsolut/2ce230fbffdf1b2e9560a11625ce7c48 to your computer and use it in GitHub Desktop.
acf-on-cpt-page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* Add ACF Options Page */ | |
| if( function_exists('acf_add_options_page') ) { | |
| /* | |
| $page = acf_add_options_page(array( | |
| 'page_title' => 'Applications', | |
| 'menu_title' => 'Applications', | |
| 'menu_slug' => 'application-settings', | |
| 'capability' => 'edit_posts', | |
| 'redirect' => false, | |
| 'icon_url' => 'dashicons-id-alt' | |
| )); | |
| */ | |
| $page = acf_add_options_page(array( | |
| 'page_title' => 'Global', | |
| 'menu_title' => 'Global', | |
| 'menu_slug' => 'global-settings', | |
| 'capability' => 'edit_posts', | |
| 'redirect' => false, | |
| 'icon_url' => 'dashicons-admin-settings' | |
| )); | |
| } | |
| /* Add ACF Options Page extending */ | |
| if( function_exists('acf_add_options_page') ) { | |
| $page_extend = 'global-settings'; | |
| // Add sub page. | |
| $child = acf_add_options_sub_page(array( | |
| 'page_title' => __('Cookies'), | |
| 'menu_title' => __('Cookies'), | |
| 'menu_slug' => 'cccookies', | |
| 'icon_url' => 'dashicons-shield', | |
| //'parent_slug' => $page['menu_slug'], | |
| 'parent_slug' => $page_extend, | |
| )); | |
| $child = acf_add_options_sub_page(array( | |
| 'page_title' => __('Case Overview Page'), | |
| 'menu_title' => __('Overview Page'), | |
| 'menu_slug' => 'overview-case-studies', | |
| 'icon_url' => 'dashicons-shield', | |
| //'parent_slug' => $page['menu_slug'], | |
| //'parent_slug' => $page_extend, | |
| 'parent' => 'edit.php?post_type=case-studies', | |
| 'capability' => 'manage_options' | |
| )); | |
| $child = acf_add_options_sub_page(array( | |
| 'page_title' => __('Podcast Overview Page'), | |
| 'menu_title' => __('Overview Page'), | |
| 'menu_slug' => 'overview-podcasts', | |
| 'icon_url' => 'dashicons-shield', | |
| //'parent_slug' => $page['menu_slug'], | |
| //'parent_slug' => $page_extend, | |
| 'parent' => 'edit.php?post_type=podcasts', | |
| 'capability' => 'manage_options' | |
| )); | |
| $child = acf_add_options_sub_page(array( | |
| 'page_title' => __('Diversity & Inclusion Overview'), | |
| 'menu_title' => __('Diversity & Inclusion'), | |
| 'menu_slug' => 'overview-diversity-inclusion', | |
| 'icon_url' => 'dashicons-shield', | |
| //'parent_slug' => $page['menu_slug'], | |
| //'parent_slug' => $page_extend, | |
| 'parent' => 'edit.php?post_type=diversity-inclusion', | |
| 'capability' => 'manage_options' | |
| )); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment