You can use is_admin();
in your if
query , http://codex.wordpress.org/Function_Reference/is_admin
Related Posts:
- How to enable suggested edits?
- How to change a user’s password programatically
- WP_User_Query and non-unique usermeta data
- How to delete custom taxonomy terms in plugin’s uninstall.php?
- To Disable WordPress Rest API or Not To Disable?
- how to include other plugins css files in a shortcode?
- Redirect to settings page after install
- Email Notifications of new posts to users – suggestions [closed]
- What is the correct way for a theme to support plugin UIs?
- What is the ‘admin_action_’ . $_REQUEST[‘action’] hook used for?
- Get URL of a specific file
- Building a plugin that doesn’t break when deactivated
- How does WordPress determine the primary plugin PHP file?
- translation does not work with text_domain
- Data sanitization escaping HTML apostrophes
- Custom comment type maybe?
- Remove Adminstrator Hyperlink from a user having role to add and see users
- Enable comments for post with comments meta box removed
- adding a text message beside the comment submit button
- Overide a function that is inside a plugin
- Having separate plugins and themes folder for multi-site setup
- Is there a plugin to record querystring parameters for a page (for customer tracking)? [closed]
- If I delete plugins via FTP are settings kept in DB?
- Many plugins making WordPress run slow by design?
- Why are some of my thumbnails not being generated?
- Remove caching from wp_remote_get calls from custom plugin
- Detect the activated theme from plugin code
- Transient unique names
- Add keywords meta to index.php page
- Can’t delete Draft Post [closed]
- How to check if tables in WordPress still exists after activations
- Looking for a way that will collect visitors emails before letting them view the blog posts [closed]
- Force file download on plugin activation
- How can I inject options into an select tag inside the widget form?
- WordPress user account activation
- Init plugin again after ajax call finish
- Unicode characters displaying as ? after import using WP Clone
- How to change the name of the “edit my profile” link in the WordPress admin backend
- Why are my queries interfering with the global post variable?
- WooCommerce : Direct Checkout Page [closed]
- Can i add custom code in Source, Header from function.php?
- Overwrite a plugin’s CSS?
- Problem with isset and $_POST
- WooCommerce product and terms count [closed]
- What are the correct permissions so WP doesn’t ask for FTP credentials if installing plugin?
- URL rewrite with external JSON query
- Adding a responsive grid onto a page (without using a Bootstrap theme) [closed]
- Class or function wrapper for plugin code
- Add a function call after content automatically?
- Var_dump ACF “API”
- Shortcode Output on Top of the Posts [duplicate]
- Detect plugin/theme installation (via upload)
- Engadget Like Featured Breaking Plugin
- sliding/fading header plugin or approach suggestion
- Google Analytics event tracking code being stripped out of links in Author box – WordPress site
- All In One SEO Plugin – Category INDEX
- Edit post image attributes on fly?
- Grouping imported products and showing variations based on selected product
- How to display ACF coustom field from category on author.php
- WordPress fatal error from php protocol codes
- Replace only the first CSS class
- Ultimate Members Default Post Layout problem
- WPBakery Page Builder Shortcode Showing On Front Page For Post
- Student access credentials
- General Term for this form Field
- how to enable/activate a plugin per Cpanel
- Gutenberg Block: How to reload a ServerSideRender?
- Comment restrictions Wodpress
- How to define the slug for my custom plugin?
- Gutenberg editor in WordPress 5.0.3 /wp-json/wp/v2/pages/4713/autosaves?_locale=user 500 (Internal Server Error)
- Is it possible to create duplicate post on other site (either push, on publish, or pull, periodically)?
- Run a Change Role Cron Job on WordPress via cPanel
- How to display variables from plugin?
- using wordpress login details for other website / application / forum?
- ACF Repeater Field Question [closed]
- Publish check if the edited content has HTML “div”
- A more elegant way to handle notices/warnings
- To set a post is new/old in vertical scrolling
- ACF repeater field
- How to remove ‘View Details’ page & updates from third-party plugin?
- Which wordpress plugin increases the size of tag as per more number of posts on it?
- Redirect default login page to a custom page [duplicate]
- appointment plugin doesn’t display all appointments
- How do I convince this button to do something when it is clicked?
- Doing action based on input from options menu
- Images not showing and plugins not installing on wordpress server move
- W3 Total Cache and IIS7 not doing much [closed]
- Mystery URL http://#/ Listed in XML Sitemap Created by WordPress SEO by Yoast Plugin
- “The Events Calendar” Issues in WP 3.2
- What are the downsides of using bootstrap in plugin development?
- How ACF Advanced Custom Field works with Woocommerce Single Product [closed]
- Function mb_strlen Fail [closed]
- How can I be a plugin developer? [closed]
- How to generate a responsive output from plugin?
- save_post hook is not working after changing priority
- The plugin generated xxx characters of unexpected output during activation
- getPost() method and Pagination
- Shortcode returning specific content of a post
- Can’t save formdata in DB
- Event Made Easy – Block registration to two or more events that have the same category