Replies: 2 comments 1 reply
-
Hi @texorama That can be already done. Check this out, please: #5 (I know docs are a pending task here. Any help it's appreciated) Esteban |
Beta Was this translation helpful? Give feedback.
0 replies
-
that's funny, I had JUST found this and fixed it that way: # for enabling htmx templates in our own codebase:
add_filter( 'hxwp/get_template_file/templates_path', array( $this, 'htmx_local_templates' ), 10, 1 );
function htmx_local_templates( $templates_path ): string {
// if the template name ends with _sx.htmx.php, then we want to load the template from the htmx-templates
// directory
if ( str_ends_with($_SERVER['REQUEST_URI'], '_sx' ) ) {
$templates_path = plugin_dir_path( __FILE__ ) . 'htmx-templates/';
}
return $templates_path;
} (I didn't want to interfere with how the rest of the code might handle htmx, so I'm changing only if the request ends in _sx which is specific to my plugin.) Thank you Esteban! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I want to use htmx in my plugin, and for that it's kind of awkward to put the call back functions "....htmx.php" in the themes folder.
How can I ship those callbacks as part of my plugin?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions