Search
 
SCRIPT & CODE EXAMPLE
 

PHP

wp_ajax_nopriv working

used for guest user (Users that are not logged in)
Comment

wp_ajax_nopriv

add_action( 'admin_init', 'child_limit_backend_to_admin_only' );
/**
 * Redirect logged in user to the home page if they are not an admin
 * 
 * @since 1.0.0
 */
function child_limit_backend_to_admin_only() {

    if ( ! is_admin() ) return;

    // If not the admin, then redirect back to the home page
    if ( ! is_user_logged_in() || ! current_user_can( 'manage_options' ) ) {
        wp_redirect( home_url() ); exit;
    }    

}
Comment

PREVIOUS NEXT
Code Example
Php :: filter data in wordpress 
Php :: docker php-fpm 
Php :: php array_walk_recursive 
Php :: php make simple loop of number elevated to exponent without pow 
Php :: laravel title dynamic 
Php :: search highlighting 
Php :: Return the union of this RDD and another one 
Php :: pg_relation_size in mb 
Php :: generate hash password in laravel online 
Php :: http://www.endmemo.com/program/R/vector.php 
Php :: remove public laravel 
Php :: Laravel 9.x Terminal can not migrate table 
Php :: recuperar dados de um objeto em outra página herança php 
Php :: fetch data from database withour restarting console php 
Php :: get original data without cast laravel 
Php :: magento 2.4.3 how to log 
Php :: php json array push in js file 
Php :: cakephp 3 get app url 
Php :: show data as per url slug change in laravel 
Php :: Yii2: Setting default values for all attributes of a model 
Php :: Wordpress Scheduled Post to be viewable on front end 
Php :: php on page query 
Php :: laravel | eloquent | db | randomly fetch | query data 
Php :: Laravel Query: orderBy not working with groupBy (with a joined table) 
Php :: how to import csv file in laravel 8 
Php :: laravel ailed: WebSocket opening handshake was canceled 
Php :: Generating Random String In PHP Using Hashing Functions 
Php :: Database connection use for validation in laravel 8 
Php :: php zoom api start_time issue 
Php :: Get authors who has posts in category - WordPress 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =