Skip to content

Reign uses a few admin-ajax.php actions for its own screens. They are not a public API. The scripts that call them ship with the theme, and the parameters can change between releases. This page tells you what a request in your network tab or security log is. It also helps you allow or block them in a firewall.

All of them are POST requests to /wp-admin/admin-ajax.php, with action set to the name below. Replies use wp_send_json_success() and wp_send_json_error(). The body is { "success": true, "data": ... } or { "success": false, "data": ... }.

Action Who Nonce Purpose
reign-signin-form Logged-out visitors only None Signs a visitor in from the popup

The popup sends log, pwd, rememberme, redirect and redirect_to. Reign calls wp_signon(), the same sign-in as wp-login.php, so security plugins apply their lockouts, captcha and two-factor checks here too. When one of them takes over the request, the popup continues on the full login page.

There is no nonce, as on wp-login.php. Page caches serve the form for days. A nonce for a logged-out visitor is the same for everyone, so a stale one only broke sign-in. Instead, Reign refuses a request the browser marks as cross-site (Sec-Fetch-Site). It also refuses a request whose Origin or Referer host is not your site. A request with none of those headers is let through, as on wp-login.php.

On success the reply is { "redirect_to": "<url>" }. It passes through the core login_redirect filter and wp_validate_redirect(), so it never leaves your site. On failure the reply carries errors (log or pwd when a field is empty). Or it carries a message with the sign-in error WordPress produced. After a successful sign-in the reign_after_login_success action fires. See Hooks reference.

What a failed request looks like, for example when you test a firewall rule.

Terminal window
curl -X POST https://example.com/wp-admin/admin-ajax.php \
-H 'Origin: https://example.com' \
-d 'action=reign-signin-form&log=&pwd='
{"success":false,"data":{"errors":{"log":"Login is required","pwd":"Password is required"}}}

The same request with an Origin from another site gets {"success":false,"data":{"message":"Security check failed. Please refresh the page and try again."}}.

These need BuddyPress or BuddyBoss and a logged-in member. Each checks its nonce first and answers Security check failed when it is missing or old.

Action Nonce action Purpose
reign_theme_unread_notification reign_notification_nonce Marks one notification (notification_id) or all of the member’s notifications (all) as read
reign_theme_mark_message_thread_read reign_message_nonce Marks one message thread (thread_id) as read and returns the new unread_count
reign_theme_mark_all_messages_read reign_message_nonce Marks every thread in the header messages dropdown as read
reign_theme_get_messages_dropdown reign_message_nonce Returns fresh dropdown markup when the badge count and the list disagree
reign_ajax_addremove_friend reign_friendship_nonce Accepts or rejects a friend request (friendship_id with data_action of friends_accept_friendship or friends_reject_friendship) from a member card

The nonce is sent as _ajax_nonce. Notification marking only touches the current member’s own notifications.

Reign prints the three nonces for logged-in members in window.wp_main_js_obj, next to ajaxurl. Code in your child theme can call an action the same way Reign’s script does. This asks for fresh messages dropdown markup.

const body = new URLSearchParams( {
action: 'reign_theme_get_messages_dropdown',
_ajax_nonce: window.wp_main_js_obj.reign_message_nonce,
} );
fetch( window.wp_main_js_obj.ajaxurl, { method: 'POST', credentials: 'same-origin', body } )
.then( ( response ) => response.json() )
.then( ( json ) => console.log( json.data.unread_count ) );

The reply is { "success": true, "data": { "contents": "<html>", "unread_count": 0 } }. With a missing or old nonce it is { "success": false, "data": { "message": "Security check failed. Please refresh the page." } }. On a page served from a full-page cache, get fresh nonces first from the nonces route.

The header badge counts do not use an action of their own. Reign adds a reign_notification_count key to WordPress’s Heartbeat response. It holds the unread notification, message and friend request counts. The badges stay current without a page reload.

Action Who Nonce Purpose
reign_install_plugin Users who can install_plugins reign_install_plugin, sent as nonce The Install free button on Reign Settings > Extend. Takes a slug from the install catalog, installs the plugin and activates it
menu_icons_update_settings Logged-in users, sent from the menu screen menu-icons-settings-update Saves the Menu Icons settings from Appearance > Menus

reign_install_plugin answers 403 without the capability and 404 for a slug that is not in the catalog. Its other failures, and what to do about them, are listed in error messages and what to do. Developers can add plugins to the catalog with the reign_install_catalog filter.

A request for a slug that is not in the catalog, sent from a Reign Settings screen where ReignGetStarted.nonce is printed.

fetch( ajaxurl, {
method: 'POST',
credentials: 'same-origin',
body: new URLSearchParams( { action: 'reign_install_plugin', nonce: ReignGetStarted.nonce, slug: 'not-a-real-plugin' } ),
} );

It answers with status 404 and {"success":false,"data":{"message":"Unknown plugin."}}.