Last active
November 7, 2020 12:32
-
-
Save qstudio/ed916e9f0af9cef6c2ee0638ebacb475 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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