Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static function init() {
- add_shortcode('single_user', array($this, 'register_single_user_shortcode' ) );
- }
- public function register_user_shortcode($atts) {
- //Settings (data get)
- $santized_atts = shortcode_atts( array(
- 'id' => 1,
- 'imagesize' => 'thumbnail',
- 'walker' => ''
- ), $atts );
- //Get data
- $data = grum_get_single_user($santized_atts);
- //Walk
- return $this->shortcode_walker ( array('walker' => $santized_atts['walker'] ) );
- }
- private function shortcode_walker ($args) {
- $object = $args['walker'];
- if ( !isset( $args['walker'] ) && empty( $args['walker'] ) ){
- $walker = new GertrudUserManagerWalker( $args );
- return $walker->walk( $data );
- } else {
- $walker = new $object( $args );
- return $walker->walk( $data );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement