'a', // a, button, badge 'href' => '#', 'new_window' => false, 'class' => 'btn btn-primary', 'id' => '', 'title' => '', 'value' => '', 'content' => '', 'icon' => '', 'hover_content' => '', 'hover_icon' => '', 'new_line_after' => true, 'no_wrap' => true, 'onclick' => '', 'style' => '', 'extra_attributes' => array(), // an array of extra attributes 'icon_extra_attributes' => array() // an array of icon extra attributes ); /** * Parse incoming $args into an array and merge it with $defaults */ $args = wp_parse_args( $args, $defaults ); $output = ''; if ( ! empty( $args['type'] ) ) { $type = $args['type'] != 'a' ? esc_attr($args['type']) : 'a'; // open/type if($type=='a'){ $new_window = !empty($args['new_window']) ? ' target="_blank" ' : ''; $output .= '"; $hover_content = true; } // content if($hover_content){$output .= "";} if(!empty($args['content']) || !empty($args['icon'])){ $output .= AUI_Component_Helper::icon($args['icon'],$args['content'],$args['icon_extra_attributes']).$args['content']; } if($hover_content){$output .= "";} // close if($type=='a'){ $output .= ''; }elseif($type=='badge'){ $output .= ''; }else{ $output .= ''; } // maybe new line after? This adds better spacing between buttons. if(!empty($args['new_line_after'])){ $output .= PHP_EOL; } // wrap if(!$args['no_wrap']){ $output = AUI_Component_Input::wrap(array( 'content' => $output, )); } } return $output; } }