How to get the admin page slug using wp_loaded hook?
How to get the admin page slug using wp_loaded hook?
How to get the admin page slug using wp_loaded hook?
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
The problem related to the getting password from $_POST[‘register_password’] variable its must between parentheses like that: // Nonce is checked, Get to work $info = array(); $info[‘user_nicename’] = $info[‘nickname’] = $info[‘display_name’] = $info[‘first_name’] = $info[‘user_login’] = sanitize_user( $_POST[‘register_username’] ) ; $info[‘user_pass’] = ($_POST[‘register_password’]); $info[‘user_email’] = sanitize_email( $_POST[‘register_email’] );
403 error for ajax POST request
Problem solved. In my case there was ‘PHP Fatal error: Call to undefined function get_home_path()’. Yup. That’s simply.
WorddPress website admin part not working correctly – I think ajax/json issue
Your event target (#calender_section a) is replaced after refreshing the calendar. Because of the replacing, the event listener isn’t applied to the target anymore. You have to apply the event listener to a parent element which doesn’t get replaced (here it is #calendrier_wrapper) and use the selector parameter of on (see http://api.jquery.com/on/): $(“#calendrier_wrapper”).on(‘click’, ‘#calender_section a’, … Read more
You only need to set the text of your A tag using $a.text(‘abc’) in your jQuery part. I did similar with the class in jQuery part of How to securely add an Ajax button to an admin page jQuery(‘#content’).on(‘click’, ‘a.rml_bttn’, function(e) { e.preventDefault(); var $a = jQuery(this); var rml_post_id = $a.data( ‘id’ ); jQuery.ajax({ url … Read more
Get post details with pure javascript ajax
how to correctly use json_encode with ajax