Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
WP Login Page API Disovery
Plugin Name: WP Login Page API Disovery
Plugin URI:
Description: Adds the WP REST API link header and link element to the wp-login.php page.
Author: Robot Ninja, Jason Conroy
Version: 1.0
Author URI:
// A REST API link element to login page head
if ( function_exists( 'rest_output_link_wp_head' ) ) {
add_action( 'login_head', 'rest_output_link_wp_head', 10, 0 );
// Add REST API link header to login page http response
if (function_exists( 'rest_output_link_header' )) {
add_action( 'login_init', 'rest_output_link_header', 11, 0 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.