I need to export post content with all filters applied to a custom API that displays in JSON.
Everything is working up until I get to one plugin: Amazon AI.
The Amazon AI plugin exports the audio player when the current page is_singular()
returns true. However, I am not loading templates in the API exporter.
Is there a way to force is_singular() to be true outside of a template, or possibly load some sort of empty template with the needed variables?
This is what I am calling from the API that fails in the Amazon AI is_singular()
if statement:
global $post;
$post = get_post($post_id);
$content = apply_filters('the_content',$post->post_content);
It doesn't seem necessary to include the amazon ai plugin code but for reference here is the file causing the trouble: https://github.com/awslabs/aws-for-wordpress/blob/master/public/class-amazonpolly-public.php
Thanks for any suggestions