Rest api return all users (even without content) to all users
Rest api return all users (even without content) to all users
Rest api return all users (even without content) to all users
the action update_user_meta is done before the value is saved in database you can try this code add_action(“update_user_meta”, function ($meta_id, $user_id, $meta_key, $_meta_value) { if (current_user_can(‘edit_user’, $user_id)) { // do something } });
You’re using get_the_date() wrong. That function gets the date of the post in a given format, and the 2nd argument is the Post ID for the post to get the date for. Not a time. The simplest way to do this would be to just use timestamps. So you can just get the post date … Read more
The JWT Authentication for WP REST API plugin offers a user authentication mechanism. You will need to: install and configure the plugin make user authentication requests against the new token endpoint optionally use the token to make further queries on behalf of users continue using OAuth 1.0 for WP/WC REST queries References: https://jwt.io/introduction/ Using JWT … Read more
Rewrite Rules and Login Issue
Yes and no wp_salt is the function you’re thinking of: https://core.trac.wordpress.org/browser/tags/4.8/src/wp-includes/pluggable.php#L1988 Your theory should be correct, copying the passwords over via SQL, and making sure all the salts are the same, then clearing cookies and trying to login, should do the trick. However, if we look at the code in the function, there are filters … Read more
It appears that you are storing the data in the post’s meta, not user’s meta. Therefore, you need to retrieve it by directly getting the meta for that post, not by doing a user query. Let’s say your post’s ID is $post_id: First, retrieve the meta by get_post_meta(): $users = get_post_meta ( $post_id, ‘post_liked_users’, false … Read more
I used this code to make subscribers upload files and it works successfully.. I think you must add true in the last line. if ( current_user_can(‘subscriber’) && !current_user_can(‘upload_files’) ) { add_action(‘init’, ‘allow_subscriber_uploads’); function allow_subscriber_uploads() { $new_role = get_role(‘subscriber’); $new_role->add_cap(‘upload_files’, true); } }
You might want to start here https://codex.wordpress.org/Customizing_the_Login_Form which discusses customizing the login form, and has info on the code file used therein. You will need to ‘hook’ into the login form using available hooks (also detailed at the above link). Also, my comment above: “Password history rules imply that you will need to save previous … Read more
Reset Password policy