WordPress.org

Ready to get started?Download WordPress

Forums

I want to html format wp_posts.post_content (1 post)

  1. Dan.LaSota
    Member
    Posted 5 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.