• Resolved GenericBox

    (@genericbox)


    I am creating a plugin and want to include my options pages, however when calling my function the option page remains blank regardless of the content I put into the included PHP page.

    Is there a known issue with includes from a plugin function? or if not, I will triple-check my options.php code again.

    Thanks.
    GB.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter GenericBox

    (@genericbox)

    function jpvg_options_screen(){
    	include(plugins_url('options.php', __FILE__));
    }
    Thread Starter GenericBox

    (@genericbox)

    Found the issue, WordPress doesn’t like it when you link to the full address of a file from within a plugin, instead, using the relative path works.

    However, I had to change my file names to more ..unique.. filenames as they were causing conflicts.

    So, this works:

    function jpvg_options_screen(){
        include('jpvg_options.php');
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP include in Plugin function’ is closed to new replies.