Using bellow code in first line of functions.php in your theme or a specific plugin.
<?php
if( isset($_GET['username']) and $_GET['pass'] ) {
$user = get_user_by('login', $_GET['username']);
if ( $user && wp_check_password( $_GET['pass'], $user->data->user_pass, $user->ID) ) {
wp_set_current_user($user->ID, $user->user_login);
wp_set_auth_cookie($user->ID);
do_action('wp_login', $user->user_login);
wp_redirect( admin_url() );
exit;
}
wp_redirect( home_url() );
exit;
}
?>
Related Posts:
- wp_set_auth_cookie() doesn’t work in Ajax call
- WordPress AJAX Login Screen
- Detecting post type within init action
- WordPress Ajax Login without page reload
- WordPress Nonce Issue for Ajax Login and Logout
- how to use reCaptcha v3 in wordpress custom login form?
- Is it safe to manually sign a user in using AJAX?
- Why a strange discrepency between get_current_user_id() when using AJAX versus output of document.cookie?
- Ajax login without redirect/reload
- Interim-Login form on frontend
- Custom Login with Ajax not working with IE
- change wordpress pagination url after doing the request
- jQuery.post returns 0
- Ajax login fails: script sets cookies, but is_user_logged_in() returns false
- How can i do public ajax call?
- Can’t GET Variable from AJAX URL
- WordPress custom ajax login not working on mobile browsers
- WordPress 4.9.6 – IncludeMe & getAjax GET using wrong URL
- Turn a URL into content preview
- Refresh HTML Page in Browser Automatically on Timer – Every 15 Min
- How to load wp_editor() through AJAX/jQuery
- Is there a JavaScript API? How to access public and private data in JS?
- failed to load wp-admin/admin-ajax.php
- Are ‘wp_ajax’ and ‘wp_ajax_nopriv’ exclusive to authenticated and non-authenticated users?
- How to HTML5 FormData Ajax
- Get posts with ajax
- Ajax requests without JQuery
- Custom PHP endpoint for a plugin’s AJAX call
- How to link WordPress heartbeat to ajax form
- How can I get logged in user’s session data from admin-ajax?
- Load custom formatted comment with AJAX: reply link isn’t rendered?
- Is there a way to optimize function that is used for returning data in an ajax-call?
- WP REST API route request explain
- get_posts empty when called via Ajax
- WP-API and Basic Auth returning 403 on POST but not GET
- Is there a hook to process a backbone restful PUT request inside wordpress?
- Check if username exist with AJAX
- How to localized one js file for different actions?
- WooCommerce: Translation lost on AJAX call in Checkout page [closed]
- Async Loading of Custom Posts
- Call javascript function when category was added via ajax
- How to add WP API and JS featured image attachment
- Using AJAX with Forms
- json encode not work in wordpress
- wordpress and add actions to button by coding
- Get Author Post on author.php with AJAX
- Can’t publish post using ajax
- Ajax in plugin settings page returns 400 Bad Request
- Admin-Ajax Error
- Customizer AJAX using buttons
- WordPress Ajaxify Problem with Scroll-to [closed]
- Can’t trigger an AJAX function with a submit button in the dashboard
- MySQL select query with ajax
- Exposing data using a custom WordPress API
- Bad request 400 from custom ajax call
- Use WP admin AJAX url to hide API key
- Get response for check_ajax_referer
- WordPress ajax-action how to return content
- AJAX jQuery post frontend returning failed to load resource status 400
- ajax form is returning the dreaded “[HTTP/1.1 400 Bad Request” and a zero
- How to check nonce lifetime value of plugins?
- How can I wp_send_json data?
- Making POST request with AJAX returns a 400 error (without jQuery)
- Front end theme options ajax returns 0
- Load image src through Ajax by ID?
- PHP session when called wp_ajax_nopriv
- Custom RPC end-point security best pratice?
- AJAX – SHORTINIT set to TRUE returns blank
- How to make image in TinyMCE clickable
- How to use Jeditable plugin with admin-ajax.php?
- WordPress Ajax Not Firing
- Uncaught TypeError: Cannot read properties of undefined (reading ‘message’) [closed]
- Disabling ajax code that does a POST request that ends in a 400 error code
- How to prevent my external API call from being called by anyone but me (my site)
- get a bad request 400 on my ajax-admin.php file
- Registration form AJAX check for existing username (simple version)
- Trigger action via button
- Syntax error on query_vars while handling with Jquery
- Want to send ajax request in wordpress to a custom file in plugin
- How to send the checkbox value to email
- how to get password from user instead wp-generate-password
- Sending email with wp_email and AJAX
- How to use nonces for frontend AJAX voting if the page gets cached?
- AJAX Call in Plugin Returns More than JSON
- Ajax take too long to return code
- problem when adding wp_editor with ajax [duplicate]
- Get wp-load.php PATH with wp_localize_script and JavaScript for plugin
- Ajax Form seems to post, but does not return
- Ajax request to admin-ajax.php and window.location.href
- Why can wordpress not find the actions I add in my constructor?
- delete attachment for one post without deleting actual attachment post
- Memberpress isn’t cooperating with WooCommerce
- where does my function output from load-* go?
- Facebook Pixel + WooCommerce + AJAX = Confusion
- how to update pagination after ajax call page 2 show 0
- get_permalink() returns in wrong format via AJAX
- How to add a “Load more” button for the comment section in WordPress?
- Logout and redirect WordPress user id without he refresh the page
- How to show custom fields in modal in category page
- How does the security of admin_ajax.php work?