Perform an additional task when a specific template/template part is loaded on the frontend.
add_action('cwicly/themer/templates', function ($theme, $slug) { // Do something here when a specific template or template part is loaded. }, 10, 2);
The action accepts two arguments:
$theme: string that returns the theme slug associated with the template
$theme
$slug: string that returns the template slug
$slug
Last updated 2 years ago