Skip to content

Instantly share code, notes, and snippets.

@qstudio
Last active December 13, 2020 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qstudio/1982c6ef9bd4b5819245b135b71b082c to your computer and use it in GitHub Desktop.
Save qstudio/1982c6ef9bd4b5819245b135b71b082c to your computer and use it in GitHub Desktop.
<?php
$ui = new ui();
$ui->hooks();
class ui {
function __construct(){}
function hooks() {
\add_action( 'init', [ $this, 'willow' ], 10 );
}
function willow(){
if ( ! function_exists( 'willow' ) ) { return false; }
// register extension ##
willow()->extend->register([
'context' => str_replace( __NAMESPACE__.'\\', '', __CLASS__ ),
'class' => 'q\theme\child\context\navigation', // force context class ##
'methods' => 'public' // public only -- default ##
]);
}
function hello( $args = null ){
return [
0 => [
'who' => 'Me',
'time' => 'Now'
],
1 => [
'who' => 'You',
'time' => 'Then'
],
];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment