I create options for my sidebar, but I would like custom posts to appear in these options as a child. Is it possible? I would like the custom post not to appear directly in the side menu, but only in the menu created by me in ACF
add_action( ‘acf/init’, ‘my_acf_op_init’ );
function my_acf_op_init() {
// Check function exists.
if ( function_exists( ‘acf_add_options_page’ ) ) {
acf_add_options_page( array(
‘page_title’ => ‘Sidebar’,
‘menu_title’ => ‘Sidebar’,
‘menu_slug’ => ‘sidebar-settings’,
‘capability’ => ‘edit_posts’,
‘redirect’ => true,
‘icon_url’ => ‘dashicons-table-col-before’,
‘position’ => 9
) );
acf_add_options_sub_page( array(
‘page_title’ => ‘Reklamy’,
‘menu_title’ => ‘Reklama’,
‘parent_slug’ => ‘sidebar-settings’,
) );
acf_add_options_sub_page( array(
‘page_title’ => ‘Patronaty’,
‘menu_title’ => ‘Patronaty’,
‘parent_slug’ => ‘sidebar-settings’,
) );
/* HERE I WANT TO CREATE SUBMENU WITH CUSTOM POST TYPE reviews and remove it directly from the admin menu*/
acf_add_options_sub_page( array(
‘page_title’ => ‘Reviews’,
‘menu_title’ => ‘Reviews’,
‘parent_slug’ => ‘sidebar-settings’,
‘menu-slug’=> ‘edit.php?post_type=reviews’
) );
}
}