How to get the id of recently registered user from database?
How to get the id of recently registered user from database?
How to get the id of recently registered user from database?
Create your blank admin page that will house this info, using add_menu_page() or add_submenu_page(). get your all the teams with get_terms() for later get all players with get_posts(), and make a foreach() loop within the loop, use wp_get_post_terms() to retrieve that players terms, use the get_terms() value made earlier to loop through the list of … Read more
A simpler approach would be to store a list/array of post-ids of the posts which have been marked read by the user in his user_meta. Then retrieve this array for every logged-in user, and run the wp_query using the post__not_in parameter with the array as the argument.
The wp_ajax_ is a prefix for your ajax action. your action is my_tag_count so its should be: add_action( ‘wp_ajax_my_tag_count’, ‘my_action’ ); You tried to access the wrong url in the ajax request because you set wp_localize_script( ‘custom’, ‘my_ajax_obj’, $ajax_url ); So the the request url should be my_ajax_obj its not an object its don’t have … Read more
I would actually load them into an array: $author_contact = array( ’email’ => get_the_author_meta( ’email’ ), ‘telephone’ => get_the_author_meta( ‘telephone’ ), ‘twitter’ => get_the_author_meta( ‘twitter’ ), ); Once you have that created, you can iterate through it using a foreach() loop: <ul class=”author-contact”> <?php foreach( $author_contact as $contact => $address ) { if( isset( $contact … Read more
I wanted to update this older question. I got this working or at least I got the saving worked out. Thanks Tom J Nowell for your input. I considerd using the REST API yes, I looked at some introductions, but this went over my head. The REST API but also AJAX is kinda new to … Read more
Get user meta on registration hook
How to gets users EMAIL by their USERNAME
To do this reliably, you’re going to have to fetch each user and pull in the meta then write it out again 1 by 1. Use a custom WP CLI command to do this. If you don’t have SSH access you can pull down a copy of the site and run it on your machine … Read more
I’ve found my mistake. I was hooking twice the same code, one in the ‘edit_user_profile’ and other in ‘edit_user_profile_update’. I have separated the display code from de update code and now it works like have to: <?php function privacity_user_profile_fields() { global $user_id; $data_consent = get_user_meta($user_id, ‘gdpr_user_register_consent’, true); $data_consent_text=”He leído y entendido el cómo se tratarán … Read more