Skip to content

Instantly share code, notes, and snippets.

@qstudio
Last active December 20, 2020 13:31
Show Gist options
  • Save qstudio/94edb95e41f5e328719c1b03fad71bdf to your computer and use it in GitHub Desktop.
Save qstudio/94edb95e41f5e328719c1b03fad71bdf to your computer and use it in GitHub Desktop.
<?php
// factory.php
$page = new q\theme\child\controller\page();
$page->hooks();
// page.php
namespace q\theme\child\controller;
class page {
function __construct(){
// ... empty ##
}
function hooks(){
// add template view ##
\add_filter( 'willow/view/custom', function( $array ){
return array_merge(
[
'page.willow' => [
'template' => 'page.willow',
'name' => 'Theme : Page',
],
],
$array
);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment