get_the_content & include_once (1 post)

  1. Schlumpfmaster
    Posted 6 years ago #

    I'm building my first plugin and I would like to know whether this is the correct way to set get_the_content() with including external php files. Almost is fine, but sometimes the content of test.php is appeared on the top of the page, outside the theme.

    function Test($myContent) {
       $content = get_the_content();
       $incl = get_the_content(include_once("test.php"));
       $content = apply_filters('the_content', $content . $incl);
    add_action('wp', 'myContent');

    Content of test.php:

    echo "Test";

    Thank you for the Feedback,

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 6 years ago by Schlumpfmaster
  • This topic is not resolved
  • WordPress version: 2.8.5