I am trying to display the content of arbitrary posts on another website.
I have the post_content I want to display in $postText.
I have a function like
<?php
require 'wp-includes/classes.php';
require 'wp-includes/functions.php';
require 'wp-includes/plugin.php' ;
require 'wp-includes/formatting.php';
function aeClean($postText) {
$postText = apply_filters('the_content', $postText);
$postText = wpautop($postText);
return($postText);
}
?>
I get this error message:
Fatal error: Call to undefined function get_shortcode_regex() in /pathToMySite/wp-includes/formatting.php on line 100
when I call the $postText = wpautop($postText); line.
Without the call to wpautop() the content is returned, but does not seem to be altered.
And I do not see anything relevant at line 100 or get_shortcode_regex() in formatting.php
My goal is to get ready for browser text directly from the post_content field. Any help would be appreciated. What functions should I call? What am I missing?