Skip to content

Commit

Permalink
Load 'redirect' module on 'send_headers' instead of 'plugins_loaded'.
Browse files Browse the repository at this point in the history
Fixes an issue with checking for REST API requests since
'plugins_loaded' runs before the REST API is loaded.

See humanmade/Mercator-Redirect#11
  • Loading branch information
r-a-y committed Oct 20, 2020
1 parent 6149f30 commit c88e750
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion redirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Mercator\Mapping;

add_action( 'plugins_loaded', __NAMESPACE__ . '\handle_redirect' );
add_action( 'send_headers', __NAMESPACE__ . '\handle_redirect' );

function is_enabled( $mapping = null ) {
$mapping = $mapping ?: $GLOBALS['mercator_current_mapping'];
Expand Down

0 comments on commit c88e750

Please sign in to comment.