Filter Date Out of JSON Code
-
Hi,
Please could you supply me with the code to remove the ‘datePublished’ from the JSON code generated by the plugin in rich-json-ld.php? The filter hook is ‘wppr_schema’, defined in class-wppr-review-model.php, but I’ve been unable to find a way to remove the datePublished.
Filter Creation in class-wppr-review-model.php:
return apply_filters( 'wppr_schema', $ld, $this );
Front-end Script Creation in rich-json-ld.php:
echo json_encode( $review_object->get_json_ld() );
I’d also like to remove the ‘offers’ section entirely, but that’s not as important.
I’ve read Actions & Filters Available, How to Change the Name, Add Filter Code Reference and various other resources.
I can filter it to show anything I want to replace it with, but not with the content that should be in there, and am unable to overcome the error:
“Using $this when not in object context”Any help much appreciated.
D
- The topic ‘Filter Date Out of JSON Code’ is closed to new replies.