Search
 
SCRIPT & CODE EXAMPLE
 

PHP

get_user_meta

global $current_user; 
 
get_currentuserinfo();
 
if ( $current_user ) {
    $permission = get_user_meta( $current_user->ID, 'some_meta' , true );
     
    if ( ! empty( $permission ) ) {
        // do stuff
    }
}
// works for both array and single values
Comment

PREVIOUS NEXT
Code Example
Php :: random color php 
Php :: install php 7.4 on ubuntu 20.04 
Php :: foreach empty laravel 
Php :: php timestamp to date 
Php :: try catch php 
Php :: laravel disable config cache 
Php :: key of last element php 
Php :: php difference between two dates in years months and days 
Php :: api headers php 
Php :: unix timestamp in php 
Php :: auth pages not getting css in laravel 
Php :: remove duplicate values in array php 
Php :: install php 7.3 on amazon linux 2 
Php :: how to check history of database in phpmyadmin 
Php :: php compare string 
Php :: php date timestamp now 
Php :: get index of element in array php 
Php :: wordpress get username 
Php :: laravel rename column 
Php :: how to get last array element in php 
Php :: remove every whitespace php 
Php :: How to prevent Browser cache for php site 
Php :: change background color php 
Php :: kill php process 
Php :: php exit foreach 
Php :: substr() php 
Php :: convert string to date php 
Php :: change laravel mix to run on different port 
Php :: laravel vendor publish all files 
Php :: laravel get last 5 records 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =