Edit user meta on front-end via AJAX

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

Right way to display the_author_meta fields?

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

not able to access $_POST on backend profile update

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

Autofill advanced custom field with user data

Yes, it can be done (it’s almost always true ;))… The question is how to do this? 😉 And here is the solution… You’ll have to use acf/load_field filter: function set_acf_field_default_value( $field ) { switch ( $field[‘name’] ) { case ‘name_provider’: $field[‘value’] = ‘PUT YOUR VALUE HERE’; break; } return $field; } add_filter(‘acf/load_field’, ‘set_acf_field_default_value’ ); … Read more

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