In the parent theme, the following is at the bottom of the functions.php file.
require_once(TEMPLATEPATH . '/admin/admin-menu.php');
In the child theme's function.php, this code will include the child admin panel.
require_once(STYLESHEETPATH . '/admin/admin-menu.php');
As you can see, I shouldn't use both files b/c the bottom file includes get_stylesheet_directory_uri()
instead of get_template_directory_uri()
for certain localized files (js, css). Thus, I need to remove the parent file from loading
I believe I need to use the remove_action
hook, but I'm not sure how to do this right. Can't find a good answer on Google either.
I started writing the following in the functions.php file in my child theme, but I don't know how to write it properly.
function remove_parent_admin_panel {
remove_action('remove_panel', '[WHAT-GOES-HERE?]');
}
Then I guess I need to use a add_action
hook to add the above function to remove the parent admin panel.
Should I wrap the parent require_once
with a function statement? Am I on the right track?