Calculate current url correctly

This commit is contained in:
Jeremy Dormitzer 2018-10-24 20:32:05 -04:00
parent 0de2b2c7e1
commit 11038262eb

View File

@ -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];