Skip to content

Instantly share code, notes, and snippets.

@qstudio
Last active November 7, 2020 12:32
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/ed916e9f0af9cef6c2ee0638ebacb475 to your computer and use it in GitHub Desktop.
Save qstudio/ed916e9f0af9cef6c2ee0638ebacb475 to your computer and use it in GitHub Desktop.
<?php
namespace q\theme\child\context;
use q\theme\core\helper as h;
// register class to willow ##
\q\theme\child\context\ui::__run();
class ui {
public static function __run( $args = null ) {
// register new class methods ##
\add_action( 'after_setup_theme', function() {
\willow\context\extend::register([
'context' => str_replace( __NAMESPACE__.'\\', '', __CLASS__ ),
'class' => __CLASS__,
'methods' => 'public' // public only -- default ##
]);
}, 2 );
}
/**
* reusable loop test
*
* @since 4.1.0
*/
public static function loop( $args = null ){
$one = [
0 => [
'title' => 'ONE: Title One'
],
1 => [
'title' => 'ONE: Title Two'
],
];
$two = [
0 => [
'title' => 'TWO: Title One'
],
1 => [
'title' => 'TWO: Title Two'
],
];
// return ##
return [
'one' => $one,
'two' => $two
];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment