Simply add the following on top of your code:
if ( ! current_user_can( 'manage_options' ) );
return;
Related Posts:
- How to check if feed URL was requested?
- problem with ajax and the path to the php page
- How to return a string that has a variable inside in a shortcode?
- Cleanest/Fastest way to avoid calling and retrieving data from the database multiple times?
- Saving metabox repeatable fields
- Targeting single page with JS
- Remove General Tab and Plugin Tab in Settings in Woocommerce
- WooCommerce – Display variation custom field value [closed]
- Use template for posts with a particular category grandparent
- How to start a script from cli within wordpress
- How to group 2 radio buttons in a widget?
- Featured image fallback link to permalink
- Facebook “like” open graph meta in header.php
- Missing sidebar parameter “fix” – before_content
- Automatically add custom CSS to new posts using a category template
- Page Automatically Generated from Theme?
- How can I reuse the code to capture a param in a URL and place in a value in a hidden form?
- Different Minimum Order Amounts based on Shipping Zone [closed]
- Displaying custom taxonomy on WooCommerce product page
- Don’t insert if permalink is the same?
- PHP errors in class-wp-query
- Store a default value for a transient on plugin activation
- Change “add to cart” button color based on Woocommerce product category [closed]
- Let Users Choose Post Categories
- $wpdb->wp_users returning empty value for
- WordPress Custom field Colors
- Display most popular posts of category
- How to correctly add Javascript to this PHP ‘Page Not Found’ Page?
- Is there a way to hook or call a custom woocomerce template that is not part of the default templates of woocommerce?
- Warning message (re. php) on the blog page
- List taxonomy term slugs within shortcode (do_shortcode)
- Get html data with javascript to php array and store to wordpress database
- How to use array in function to get only value I want
- Apply class to every third list item? [duplicate]
- How to include custom code on a page that’s set to act as homepage?
- How to upload WP user avatar on woocommerce account page [closed]
- Fixing Deprecated: get_the_author_lastname
- add_filter function concatenate string and locate_template function
- HTTP ERROR 500 after installing child-theme [WordPress] [closed]
- wordpress frontend editor to add extra css to website
- How to return a string that has a jQuery and Ajax inside in a shortcode?
- How to get a list of users who like a current wordpress post [closed]
- ‘pre_user_query’ interfering with user export
- Custom CSV exporter – Cannot modify header information – headers
- Custom post type url Rewrite (conflicting with page url)
- pagination broken – clicking next displays “page not found”
- PHP: How to access db the right way in plugin?
- How to decrease the max file upload size without using php.ini or htaccess?
- populate select options from extra mysql table data
- Custom forms with HTML
- Pagination at category doesnt work with same name of page
- How to remove the two duplicate values
- AJAX function running TWICE with WordPress admin-ajax.php
- OOP PHP class extends TwentyTwenty_Customize in Child Theme
- PHP using external anonymous function inside class
- Is it secure to use SMTP password in .php file in WordPress website?
- Woocommerce – Exclude variation attribute on specific variation
- Sort new column in Users wp-admin
- How to spell out a word in products/posts?
- call to undefined function mysql_connect
- Can’t pass var from php wp_ajax into ajax script : result undefined or null
- Custom PHP form needs refresh to load page correctly
- Child-Theme Category View with modified permalinks (%category% removed)
- Log out without confirmation request (nonce)
- Add Pre-Defined Value to Click Counter in WordPress
- Create a WordPress Contact Form to call a POST AWS API Gateway and send user data
- Show data obtained from a function and place it in a shortocode function
- Get WordPress username to customize url
- Delete empty title_tags, find a h1 heading and echo it
- Get posts from year from URL
- HELP: cannot log into wordpress. PHP error
- WordPress is setting from header wrongly in wp_mail
- Add post title as a link parameter
- Help with find a bit of code to move from functions.php
- Search for images that width and height is more than 500
- How do I get object if class is instantiated only like this new classname()
- How to create a php page to collect information from a html page
- Default Image not showing up in Customizer for WP_Customize_Cropped_Image_Control
- I need help implement a Javascript code into the PHP file
- Passing different content to template parts
- Filtered table in wordpress
- My customizer’s setting doesn’t set to the default and needed to click the control’s “Default” button before it’ll be set
- Run insert if no entry otherwise run update with ajax
- Hide cart when empty [closed]
- Overwriting a Shortcode
- WordPress changing single quotes to double quotes in title and content
- Post Title Not showing up
- MySQL database migration to WordPress
- How to check if a value exists in one of two database tables
- Is this WordPress code causing page weirdness? Can’t scroll to bottom
- Search result page – display values from the result’s metaboxes
- How to use multiple 404 Error Pages in WordPress
- Parse error: syntax error, unexpected ‘}’ in
- WordPress add parameters with friendly url structure
- Different behaviour between “include_once” and directly echoing out html code?
- save array of objects with update_option
- What is the best way to reset the site? Different fails while set up
- Themeco Looper Provider Query String for current user posts [closed]
- Remove colon from CTP UI “Singular Label”
- Customize create table SQL statement in any WordPress plugin