How to change the value of a variable using input field?

Please try below snippet of code. HTML : <input name=”getUser” id=”getUser” value=””/> <div id=”user_data”></div> JS (js/my-ajax-script.js) jQuery(document).ready(function($){ $(‘#getUser’).keyup(function(e) { var user_id = e.target.value; console.log(user_id); $.ajax({ url:my_ajax_object.ajaxurl, #add here your ajax url type:’POST’, data:’action=get_this_user_data&user_id=’+user_id , success:function(results) { jQuery(‘#user_data’).html(results); } }); }); }); Ajax (add in functions.php) function my_enqueue() { wp_enqueue_script( ‘ajax-script’, get_template_directory_uri() . ‘/js/my-ajax-script.js’, array(‘jquery’) ); … Read more

Allow specific user to edit a specific page

The issue is that an empty return value from map_meta_cap will grant all users permission to do that thing, because that’s essentially the same thing as saying “no capabilities are required to do this”. What you really want to do is just add edit_special_page to the existing list of required capabilities: add_filter( ‘map_meta_cap’, function( $caps, … Read more

How To Export User’s Custom Fields in CSV or XLSX

Probably the easiest way to do this is to connect to the database using MySQL Workbench or similar, and extract the data using a SQL query e.g. select u.user_login, u.user_email, m1.meta_value as first_name, m2.meta_value as last_name, m3.meta_value as billing_codice_snep, m4.meta_value as codice_snep from wp_users u left join wp_usermeta m1 on m1.user_id = u.id and m1.meta_key … Read more

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