From 11038262eb19be5b915ef9abbab68cad429a8af5 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Wed, 24 Oct 2018 20:32:05 -0400 Subject: [PATCH] Calculate current url correctly --- includes/server/api.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/includes/server/api.php b/includes/server/api.php index ad382b7..f02e1b9 100644 --- a/includes/server/api.php +++ b/includes/server/api.php @@ -119,9 +119,7 @@ function handle_non_api_requests() { global $wp_query; $accept = $_SERVER['HTTP_ACCEPT']; if ( strpos( $accept, 'application/ld+json' ) !== false ) { - $current_url = \trailingslashit( - home_url( add_query_arg( $_GET, $wp->request ) ) - ); + $current_url = home_url( add_query_arg( $_GET, \trailingslashit( $wp->request ) ) ); $objects = \pterotype\objects\get_objects_by( 'url', $current_url ); if ( count( $objects ) > 0 ) { $object = $objects[0];