Open monecchi opened 4 years ago
Hi @monecchi , I looked at the source and it turns out the $templatePath
should be relative to the views
directory of the plugin: https://github.com/janizde/WP-Opening-Hours/blob/c604366d3f13541747c485d57878e9f489c65ef0/classes/OpeningHours/Module/Shortcode/AbstractShortcode.php#L122-L151
This is certainly documented wrong and is actually not such a sensible API I must admit. Can you please try to return a path like ../../../mytheme/inc/shortcodes/wp-opening-hours/is-open.php
?
I can't really change the API of the filter in a patch, but maybe I will add an additional filter op_shortcode_template_absolute
or so.
Any working solution? I´m not a php programmer - just being able to get by. If i paste echo $templatePath; after line 129 it shows the correct path to child-theme. If i paste it after line 147 path is not correct - it shows the pluginpath and chlidthemepath in one line. In my understanding it means to override the op_plugin_path(). But how to do that? Or is it the false conclusion? thank you in advance
@dudgemaster I'm wondering if the ´op_shortcode_template´ filter is broken?
I'm placing the function bellow on my theme's functions.php, I'm not sure though if the path format is valid. I've copied the
is-open.php
shortcode template from/views/shortcode/is-open.php
to my theme's include folder under/inc/shortcodes/wp-opening-hours/
I'm really interested on changing the shortcodes markup, any help regarding this issue is appreciated. Thanks for the great plugin!