Skip to content

Instantly share code, notes, and snippets.

@yratof
Last active May 26, 2016 21:23
Show Gist options
  • Save yratof/a7d2f7bf1ffbc15fb60c to your computer and use it in GitHub Desktop.
Save yratof/a7d2f7bf1ffbc15fb60c to your computer and use it in GitHub Desktop.
ACF - Advanced custom fields reorder menu item
<?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