WordPress Plugin PHP Not Calling Function

by Terry   Last Updated May 15, 2019 21:08 PM

I've recently created a custom WordPress plugin to keep track of submissions, reviews etc things on my website.

I built all of this in a single main plugin file and before launch I'm looking to clean it up a little and split the code into separate files. I've spent the last couple hours trying to figure this out myself and have had no joy.

main.php

include plugin_dir_path( __FILE__ ) . 'reviews.php';

reviewsPanel();

reviews.php

<?php

function reviewsPanel() {
    ?>
    echo "test";
    <?php
}

?>

Each file is in the plugin directory and the plugin_dir_path function does return the correct path.

Thanks for the help.



Related Questions


Updated July 13, 2018 15:08 PM

Updated July 21, 2018 17:08 PM

Updated January 25, 2019 10:08 AM

Updated July 13, 2017 10:08 AM

Updated December 29, 2017 23:08 PM