You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add_action( 'parse_request', array( $this, 'init' ), - 1000 ); // Not crazy low, but low enough to catch most cases, but not too low that it may break AMP.
76
+
if ( ! defined( 'REST_REQUEST' ) || ! REST_REQUEST ) { // Not needed on REST API.
77
+
add_action( 'parse_request', array( $this, 'init' ), - 1000 ); // Not crazy low, but low enough to catch most cases, but not too low that it may break AMP.
78
+
}
77
79
}
78
80
79
81
/**
80
82
* Add filters for REST API.
81
83
*/
82
84
protectedfunctionadd_rest_filters() {
83
-
$types = get_post_types_by_support( 'author');
85
+
$types = get_post_types();
84
86
foreach ( $typesas$type ) {
85
87
$post_type = get_post_type_object( $type );
86
88
// Check if this is a rest supported type.
@@ -255,7 +257,7 @@ public function replace_strings( $content, $context = 'view' ) {
255
257
}
256
258
if ( Utils::looks_like_json( $content ) ) {
257
259
$json_maybe = json_decode( $content, true );
258
-
if ( $json_maybe ) {
260
+
if ( ! empty( $json_maybe ) ) {
259
261
$content = $json_maybe;
260
262
}
261
263
}
@@ -264,7 +266,8 @@ public function replace_strings( $content, $context = 'view' ) {
0 commit comments