How can i create an array user meta?

As noted at the codex page for get_user_meta(): NOTE If the meta value does not exist and $single is true the function will return an empty string. If $single is false an empty array is returned. So I would suggest to do the check like this: ! empty( $themeta ) Regrading your other question, you … Read more

Author list ‘special’ author first then ‘normal’ author

The ‘special’ authors have in usermeta a meta key called ‘werksortgodmodus’ with meta value ‘yes’. The ‘rest’ of the authors have ‘werksortgodmodus’ = no . You could e.g. order by the meta value with (PHP versions 5.4+): $blogusers = get_users( [ ‘role’ => ‘author’, ‘meta_key’ => ‘werksortgodmodus’, ‘orderby’ => [ ‘meta_value’ => ‘DESC’, ‘display_name’ => … Read more

Log all users out of all locations after 24 hours

There are few ways to accomplish what you want. I won’t give you any use-ready solution but just an idea. First idea You could set up cron job to replace authentication keys in wp-config.php, you can get them over here https://api.wordpress.org/secret-key/1.1/salt/ This way you will force all of the users to log in again. Second … Read more

How to update custom user meta field in wp?

You are using the wrong meta key: update_user_meta( $user_id, ‘Save Posts’, $_POST[‘save_post_external’] ); update_user_meta( $user_id, ‘Save Posts’, $_POST[‘save_post_internal’] ); And that should be: update_user_meta( $user_id, ‘save_post_external’, $_POST[‘save_post_external’] ); update_user_meta( $user_id, ‘save_post_internal’, $_POST[‘save_post_internal’] );

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)