Last active
May 26, 2016 21:23
-
-
Save yratof/a7d2f7bf1ffbc15fb60c to your computer and use it in GitHub Desktop.
ACF - Advanced custom fields reorder menu item
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 | |
/** | |
* Theme options for custom mega menu | |
*/ | |
if( function_exists('acf_add_options_page') ) { | |
$theme_option = 'theme-options'; | |
acf_add_options_page(array( | |
'page_title' => 'Theme Settings', | |
'menu_title' => 'Theme Settings', | |
'menu_slug' => $theme_option, | |
'capability' => 'edit_posts', | |
'icon_url' => 'dashicons-admin-settings', | |
'position' => 2, | |
'redirect' => false | |
)); | |
acf_add_options_sub_page(array( | |
'page_title' => 'Main menu', | |
'menu_title' => 'Main menu', | |
'parent_slug' => $theme_option, | |
)); | |
} | |
// Put an options page on a custom post type | |
if( function_exists('acf_add_options_page') ) { | |
$where = 'banners'; | |
acf_add_options_sub_page(array( | |
'title' => 'Banner settings', | |
'parent' => 'edit.php?post_type=' . $where, | |
'parent_slug' => $where, | |
'capability' => 'manage_options' | |
)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment