Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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