Plugin template override with undefined variable
-
Hi,
I’m trying to let users of my plugin override plugin template via their (child) theme, by using this tutorial.
It works, but not when adding my own plugin template file.
My file contains many variables and I’m only getting the undefined variable notifications:Notice: Undefined variable: output in in C:\wamp\www\my-domain\wp-content\plugins\my-plugin-slug\my-template-file.php on line 8 Notice: Undefined variable: page_meta_section_start in C:\wamp\www\my-domain\wp-content\plugins\my-plugin-slug\my-template-file.php on line 10 ETC ETC
I have no idea why this happens, every variable is initialised within my plugin.
Even without overriding this file (so when it uses native plugin file) I encounter this.
I include file similar to how mentioned in tutorial:$output .= wcpt_get_template( 'my-template-file.php' );
Any ideas?
Guido
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Plugin template override with undefined variable’ is closed to new replies.