Created
December 22, 2022 20:50
-
-
Save dshanske/e2659241f1c8c064441737afbd89654c to your computer and use it in GitHub Desktop.
ActivityPub Xray Override
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'init', 'activitypub_xray_override_init', 11 ); | |
function activitypub_xray_override_init() { | |
$user_agent = $_SERVER['HTTP_USER_AGENT']; | |
$accept_header = $_SERVER['HTTP_ACCEPT']; | |
if ( stristr( $accept_header, 'application/activity+json' ) && stristr( $user_agent, 'XRay' ) ) { | |
remove_filter( 'template_include', array( '\Activitypub\Activitypub', 'render_json_template' ), 99 ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment