One option is to examine the $hook
and see, if it matches the parent or any of the child menu page slugs.
function load_entry_scripts($hook)
{
$hook_parts = explode('_page_', $hook);
$menu_slug = array_pop($hook_parts);
if ( ! in_array( $menu_slug, array('my-parent-page-slug', 'my-child-page-slug') ) ) {
return;
}
// add styles && scripts
}
Related Posts:
- Adding submenu to custom plugin menu page created with add_menu_page() function
- How to Call Specific .PHP file on add_submenu_page selection in Plugin Development?
- How to load different css file for different pages
- Master menu item for multiple plugins?
- Is it possible to enqueue CSS files from plugin before theme’s CSS files?
- Determine Registered Admin Menus
- Making a plugin only available on the front-end for the logged in super admin
- Adding Font Awesome to WP Plugin
- Howto check version of another plugin and then add a submenu page to it
- wp_enqueue_style on template_redirect level?
- plugin enqueue style on all pages
- is it possible to hook every page style?
- How to hide plugin submenu title in drop down in admin panel in wordpress?
- wordpress plugin add page when activate
- Admin menu hilighting wrong item for CPT
- Multiple plugins settings of same developer into ONE settings page linked together
- Pass PHP variable to javascript
- Namespaces in WordPress – How do I initiate the main class?
- wordpress get meta value by meta key
- What areas to Unit test while building a plugin?
- Get info (url) from already enqueued styles
- update_meta_user difference in i:1 and b:1, how to write b:1
- Registration Form Validation in wordpress
- Plugin throws up 404 on front-end when when enqueuing style with filetime
- Errors while using ajax from external wordpress page
- Dequeue / Deregister script and replace it with a new plugin
- How to handle autoloading with composer by keeping the WordPress naming conventions?
- filemtime() warning when enqueuing style within plugin
- Hide Theme options and Customize Admin menu
- Current user in plugin returns NULL
- How can I implement a notification system in wordpress?
- Minimum PHP Required for WordPress
- Building an email signup form. Where should the information be saved in the DB?
- Custom form action to handle data inside a plugin
- WP Post Template – Templates in own folder
- Create entire wordpress as a github repositery?
- Map Custom Registration Fields to WordPress User Roles
- custom payment gateway in woocommerce failed to connect to remote api server
- Plugin options page with live preview?
- Ajax call returning 0
- How to update post’s content on post publish?
- WordPress plugin admin html being shown in Customizer iframe
- Ordering taxonomies by rank
- Plugin Options not being output
- Can I create a table on my DB without creating a plugin?
- Submit Form data to another page via Ajax (WordPress Way)
- WordPress checkbox and Illegal string offset
- Is it fair to use MIT licensed code in WordPress plugins? [closed]
- How to add an element right after the article using jQuery?
- How to reset wordpress but not plugins and settings
- add_submenu_page returns null
- get_option / wp_localize_script Not Working in OOP Plug In
- How to Show Author image and url in WordPress plugin directory? [closed]
- Extending a theme: build new features as plugin or core modules?
- Plugin generating unexpected output – on WP mysql dump import
- Remember the Meta Value With Radio Buttons
- jQuery code didn’t run on my plugin
- How to embed a new string in url?
- Custom characters of tinymce editor are saved as question mark
- Custom Module, Extending WP with a Plugin?
- How do I profit from a Plugin?
- help intercepting save_post through plugin
- best way to run a php script away from the template?
- Themes conflicts and overrides my WordPress Support widget Plugin styles
- How to save Setting pages data to the database?
- Add hook after content without formatting
- User loggedin as Subscriber form not sending
- wc_get_template_part doesnt display the content [duplicate]
- How to properly use wp_mail() in my own plugin?
- Prevent WordPress from sending set-cookie http header
- admin_post hook not firing function inside class
- How to store a secret for a plugin inside public_html
- Problem with checked box on wp car manager plugin
- How to use functions found inside pluggable.php with my plugin files
- Is it okay to make a plugin to the WordPress repo, but limit it’s actions to maximum N events?
- Create a link that calls our custom function in WordPress
- Update a previous version of plugin when the new plugin is built from the scratch
- AJAX update fails for public/non-admin users
- WordPress Product Detail and catalog
- Woocommerce list variations that are added already to cart in Single Product
- Plugin json page
- search into subcategories plugin subcategory value not come
- Why isn’t my plugin seeing other classes?
- How Can the_post Be Hooked Like the_content and the_excerpt?
- Create Database Tables on Plugin Activation hook
- How to add php stylesheet to admin section instead of admin_head hook
- How to tell which Plugin is displaying?
- Change page according to fetched GET Parameters
- Get Core Functionality from Within a (Secondary) Plugin File
- wp_insert_post_data filter to set category
- Plugin keeps saying needs to be updated and it’s in a constant loop [closed]
- How to provide access to specific plugin to all the user roles except subscriber in wordpress
- Output pure JSON wordpress
- how to remove a rel=”nofollow” using call to action plugin
- Activate plugin button do nothing [closed]
- wp_handle_upload – specified file failed upload test
- how to make wordpress remember my choice
- Meta box not displaying on the plugin page
- wordpress admin-ajax bad request 400
- public custom posts not showing in my wordpress plugin