@karkidennis Glad it’s working mate ??
I’ve just released v1.8.1 with the WP_MMD_RAW_DATA constant so you can disable the filter through a specific “loading”* hook of your choice.
- For example you can add the following snippet inside you wp-config.php to disable globally the html output :
define( 'WP_MMD_RAW_DATA', 1 );
- Or inside a hook from your child’s theme functions.php file :
add_action('init', function() { if ( ... ) { define( 'WP_MMD_RAW_DATA', 1 ); } });
The side effect with the REST API is that the related hooks or constants like REST_REQUEST created by WordPress are setup at the beginning of the “processing”* stage, just after the “loading”* stage has finished, which is too late.
To make it short it will remain a specific case with the current plugin’s structure and to avoid “delicate” modifications or unwanted side effects, the best way to target the REST API – with other plugins as well to my mind – is still the use of the snippet provided last week or a variant like the following one :
add_action( 'rest_api_init', function() {
remove_all_filters( 'the_content' );
remove_all_filters( 'the_excerpt' );
});
*By loading and processing I’m referring to this chart :
https://blog.lancecleveland.com/2017/10/11/wordpress-hooks-and-filters-order-of-precedence/
I hope the explanations / reference is gonna inspire you, and if you don’t mind I’m gonna mark the issue as resolved ??