0

functions.php

require get_parent_theme_file_path( '/inc/option-admin-page.php' );   

option-admin-page.php

function admin_page(){
    add_menu_page('menu page','Option Panel','administrator','admin_option_slug','admin_adjustment','', 22);    
    add_submenu_page('admin_option_slug','reservation_title','reservation page','administrator','reservation_slug','reservation_subpage');  
    add_submenu_page('admin_option_slug','contact_title','contact page','administrator','contact_slug','contact_subpage');  

}
 add_action('admin_menu', 'admin_page');
function admin_adjustment(){
echo '<h1 style="text-align:center;">This page is for the Admin menu page Option </h1>';?>
<?php  } ?>

      <!-- reservation page -->
 <?php get_template_part( 'template-parts/reservation', 'menu' ); ?> 


    <!-- contact page -->
  <?php get_template_part( 'template-parts/contact', 'menu' ); ?> 

enter image description here

I have this custom menu page and sub menu page

Both add_menu_page and add_sub_menu page are working this contains:

reservation page and contact page

Somehow it preventing Media library from loading the images, it just keep on loading, I found out the custom add_menu_page preventing it from loading the media library, Any solution for this?

  • Show us some errors, either on PHP level or your browser console. – Michael Sep 29 '18 at 11:44
  • it does not have any error from console,If you click media the icon beside bulk select just keep on loading – jayllopy Sep 29 '18 at 11:53
  • Something might be breaking in the Ajax callback. You could enable debug to log file using define( 'WP_DEBUG_LOG', true ); in your wp-config.php and then read that log file. codex.wordpress.org/Debugging_in_WordPress – Michael Sep 29 '18 at 11:55
  • yeah i found some error and fix it somehow nothing change.i'll update the post – jayllopy Sep 29 '18 at 12:20
  • Im confuse when i comment out the require get_parent_theme_file_path( '/inc/option-admin-page.php' ); in function.php it somehow fix which means part of option-admin-page.php causing the problem, and when I comment out all inside the option-admin-page.php it does not fix – jayllopy Sep 29 '18 at 12:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.