You can try with the following example to stop the code running on admin
side or on wp-login.php
page.
if ( ! is_admin() || 'wp-login.php' != $GLOBALS['pagenow'] ) {
// Do stuff here. code inside this statement will
// not run on wp-admin & login page.
}
Related Posts:
- How to get the path to the current theme?
- Post meta vs separate database tables
- How to add a javascript snippet to the footer that requires jQuery
- Enhance Media Manager for Gallery
- Inserting Taxonomy Terms During a Plugin Activation?
- Replace audio/video enclosure with player?
- wp_mail is undefined
- How do you use the plugin boilerplate loader class to hook actions and filters?
- Contact Form 7: wp_mail doesn’t work after update to 4.6
- Gutenberg ServerSideRender is deprecated, how to work with new wp.serverSideRender component?
- How to: Rest endpoint returning empty object
- Ensuring a plugin is loaded/run last?
- Turn revisions off in plugin instead of config.php?
- Add an image gallery to a custom post type?
- Unit testing wordpress plugins with plugin options
- Create a clickable name in WP_List_Table for Plugin Admin
- Plugin development without Theme adjustments?
- How to Make a Category Always Selected?
- Script to remove all inactive widgets?
- Disable $title in Plugin Options Screen?
- WordPress Localization and Templating
- DIR vs URI when defining a path to a file
- Why after a file is programmatically deleted, is there still a reference in the media library?
- Can’t we use strings defined as PHP constants if we want to translate them in a plugin?
- JS / JQuery form validation in backend admin menus
- My new WordPress plugin version is not showing up in the plugin directory. It’s been 4 days what could the problem be?
- DataBase connection problem with PHPUnit and WordPress
- Is using register_activation_hook required?
- Synchronize Custom post type tags to WordPress default posts tags
- Tabbed navigation for plugin options using same row in database for all?
- Ethics question: what qualifies as a fork? [closed]
- Add a panel to edit post
- Auto-Update Plugin Creating .tmp directory, not overwriting old version
- Cannot update …/tags folder in SVN Repository
- Register a sidebar in a WordPress plugin
- Is there a way to ensure plugin script loads before another script?
- ORDER BY wp_post custom column name in wp_query
- Verify if user is wordpress logged in from another app since wordpress 4.0
- How to stop your plugin from executing on certain pages?
- Is it necessary to sanitize plugin options?
- Search the product by tag or category not working
- How to filter content for specific content variable
- PowerPress mobile media player
- You do not have sufficient permissions to access this page on a submenu
- WordPress function get_the_terms() returns ‘Invalid taxonomy’ error
- Trying to Implement .pdf File Upload in Admin for plugin
- Writing a wordpress plugin and trying to include the Facebook PHP SDK
- Codex Version Focus on Production or Nightly?
- how to invoke wordpress API from other existing PHP system
- How to cancel update messages from a changed plugin
- How to get the post excerpt using post object?
- Fatal error: Uncaught Error: Call to undefined function convert_to_screen()
- How to import the css in the plugin admin area?
- how to get the post id in plugin
- What’s the impact on WordPress’ performance regarding the amount of classes/files in a plugin?
- Using add_sub_menu to put into Appearance Section
- Using AND and bracket grouping in SQL not working
- Taxonomy archive page listing terms instead of posts
- How to call code when adding WooCommerce menu items via woocommerce_account_menu_items
- jquery in wordpress plugin with depdendency
- Plugin creation, restricting access to specific roles
- wordpress automatic update does not run
- How to avoid conflict of plugin style and theme style?
- Ajax +wordpress onClick link redirect to new page and create html content
- How to move an image in a plugin to the upload directory and make it as a media of wordpress?
- Is it possible for two WordPress plugins to share the same code base?
- Script to replace default blogroll with links to my social media URLs
- How to show multiple instances of the WP125 Widget?
- wp.media libary pdf type
- Add multiple checkboxes as single field to Custom Shipping Method Settings Page
- Posts form with AJAX request – Plugin development
- register_meta not showing custom post type metabox data in rest api
- Want to know how to reveal a WordPress theme, considering the theme name is hidden?
- Save meta box data from selected dropdown list in bbpress reply form
- Sanitize WordPress Array Input?
- Events Manager: Create custom Placeholder for use in Email notification
- WC REST API Error Handling
- Using the same class across multiple functions
- woocommerce add a new bulk action in the bulk actions dropdown in the orders list
- Creating a virtual page without exit
- Ajax Response Error | just getting error as the response
- admin-ajax.php returns “No Script Kiddies!” sometimes
- Widget won’t be activated
- Building WordPress Themes With Bootstrap with Adi Purdila → TutsPlus
- Allow user to change homepage
- Need to change buddypress profile url by add_rewrite_rule
- Generate activation url
- Use different archive template for plugin
- Get custom wp_query search results to appear on search.php
- Is it safe to use PUT and DELETE requests
- Multi-part form and wp_redirect()
- Sharing changes to a post (preview changes) with another user
- PHPUnit Ajax Serialization of ‘Closure’ is not allowed
- Settings API not Saving to Database or Display
- Error using @wordpress/create-block to create multiple blocks on Windows
- upload image to wordpress media library failed for custom post type
- Fetch Custom Woocomerce filed data and check the data avialble in Wp-user table as nicname or username using function.php
- How to get locale within WP REST Request?
- How to add extra EXIF data when images are uploaded?
- How to boost WP custom post REST API GET queries by custom taxonomies