is_admin() is useful for the front end.
The load-$pagenow hook and a few others are useful on the backend. wp-admin/admin-header.php, for instance, contains:
do_action('admin_enqueue_scripts', $hook_suffix);
do_action("admin_print_styles-$hook_suffix");
do_action('admin_print_styles');
do_action("admin_print_scripts-$hook_suffix");
do_action('admin_print_scripts');
do_action("admin_head-$hook_suffix");
do_action('admin_head');
Note the $hook_suffix variable, which you can var_dump() then and there to know what its value is when your plugin’s page is being loaded.
Related Posts:
- Creating a plugin with dependencies
- difference between add_options and register_setting
- Is it possible to stop selected plugins from loading on certain template pages?
- Creating a WordPress admin page without a menu for a plugin
- Common functionality between my own plugins
- Filter Orders in Admin area, based on Custom meta
- What happens when wp_cron is deactivated in WordPress?
- How can I install a plugin on a WordPress.com hosted blog?
- How To Ignore a Filter On Applying Filter the Content In a Function
- Which functions in theme or plugin load first
- Add CSS animation as Preloader to WordPress
- Plugin to restrict login and unpublish content from an author
- How to use wp-ajax in wp-cron
- remove custom taxonomy metabox form custom post type
- How to get list of Scripts in Order of Dependencies
- Is it possible to make shortcodes NOT case sensitive?
- Overriding a function in wordpress
- Woocommerce “out of stock” message [closed]
- Travel Blog Plugins
- How to remove the whitespace in image name and save the new file
- Custom height/width for thickbox in WP Backend
- add action wp_head not working
- Cannot access wp-admin after disabling all plugin
- Assignments must be the first block of code on a line Validation Error on Travis
- What is Stable Tag in WordPress plugin readme file
- Error 404 using wpml plugin
- Next and/or previous post content
- WordPress functions give fatal error in included php file
- How to configure two SMTP Server for wordpress
- Preferred way of cacheing a value in php
- Internationalization autocomplete JS variable
- Override global query results without hooks
- Rotating background images with admin options
- Howto accurately position images with maximum flexibility?
- Using a post-signup hook to get user details
- How to merge two .PO language files?
- wp_remote_get() returns 403 while file_get_contents() does not
- How to set add question capability for author role in wp pro quiz plugin
- Which widget to use for display category post with view more? [closed]
- Create a multisite network for an existing installation
- AFNetworking incorrectly interpreted WP_Error
- polylang + category/tag custom language link
- Unable to delete custom post types, confusion around capabilities
- How to create multiple database tables on plugin activation?
- What’s causing this error? “Warning: Invalid argument”
- Is it possible to remove subscription box from Jetpack stats page? [closed]
- How to create a post with next buttons
- How to display terms and conditions in post area?
- How to notify wordpress instalation about my plugin update?
- Plugin onclick button activate other plugin
- Moving FB comments at the end of page
- How to override the Buddypress bp-members folder’s file?
- What is it and from where it is loaded?
- Site shows URL instead of “meta title” after deleted few plugins (not any SEO plugin was deleted)
- Use Plugin Whenever One Exists?
- BuddyPress activity on edit post for a CPT
- How to make a textarea accept javascript in my settings apge?
- Get data from wp_posts of mysql in to variables of wordpress-php script
- Change url of posts with keywords
- WordPress plugin won’t create custom tables
- Ajax Call in page theme not working?
- Trying to use shortcode for a plugin on custom homepage of Responsive theme
- How to enqueue some javascript source once per page
- Adding featured image to posts created by a plugin
- wp redirect 301 not working in wordpress page
- Yoast SEO Plug In and my Theme duplicating code. Need some feedback on what to do? [closed]
- Advanced video gallery plugin needed [closed]
- Displaying URL Based on User Input from a Form W/in a Dashboard Widget
- Is there any plugin to show number of clicks on the link?
- Display Author name PHP (Selfmade Plug-IN)
- how to resubmit a submitted form with gravity forms plugin
- wordpress plugin add page when activate
- Validating ajax search
- problem disabling plugin only for mobile
- WordPress hide post from custom post-type on a single page
- Installation failed: 504 – Gateway Timeout
- Create survey that redirects to sidebar menu customized to answers
- Uploading images to custom table
- Plugin Version List not Shown
- How can I refresh the plugins cache manually?
- Scheduled emails to include only posts and calendar events for the upcoming week
- worldpay class not working with namespace in WordPress
- How to change meta data(title, description) for current post?
- WordPress on shared server Plugin not working
- How save plugin options array in select box
- How to install jquery dotdotdot plugin for WordPress?
- To Store value in variable via text box
- Plugin Translation project not found
- Manually return false for function_exists
- Filter EVERY category link with my plugin
- How to make plugin work in each template in wordpress
- Expanding / Collapsing Modules in WordPress Panel
- Strange Search Query Appearing on Google Index – “/?q=Save+Us+From+Berlusconi”
- How put a file when the email is sent to user contact form 7
- New admin account cant access plugins.php
- How to add plus minus button on Input Quantity box Woocommerce? [closed]
- How to modify submit button on GravityForms
- How to Order Posts by Taxonomy in Jetengine Plugin
- Detect if user is on the specific page in WordPress
- A multi-section WordPress store [closed]