-
Notifications
You must be signed in to change notification settings - Fork 82
Description
Hi
We are experiencing loading errors when using template overrides for some pages!
I believe this issue is caused by functions such as tutor_load_template_from_custom_path(), which determine the target file path using the __DIR__ constant.
In such cases, if a template containing these functions (that rely on __DIR__) is overridden, the sub-template paths are resolved relative to the child theme template instead of the plugin directory. As a result, if the sub-template files are not also overridden, loading errors occur.
On the contrary, , when a template loaded using __DIR__ is overridden, the overridden template does not take effect. For example:
If the single-content-loader.php template is overridden, all associated templates—
single-lesson.phpsingle-assignment.phpsingle-preview-lesson.phpsingle-quiz.php
must also be copied into the child theme directory without any changes.
The following code demonstrates that single-content-loader.php is being loaded from the plugin's template directory rather than the child theme directory:
tutor/templates/single-lesson.php
Line 11 in 7015253
| tutor_load_template_from_custom_path( __DIR__ . '/single-content-loader.php', array( 'context' => 'lesson' ), false ); |