Description
Implement [bw_dash] shortcodeIf there's any content then this is also displayed. The styling may be a little wonky. Originally the code created a div, now it creates a span This makes it easier to use dashicons inline.
Usage
$string = bw_dash( $atts, $content, $tag );Parameters
- $atts
- ( array ) optional – shortcode parameters
- $content
- ( string ) optional – not (really) expected
- $tag
- ( string ) optional – shortcode tag
Returns
string generated HTML for the dash formSource
File name: oik-bob-bing-wide/shortcodes/oik-dash.phpLines:
1 to 41 of 41
function bw_dash( $atts=null, $content=null, $tag=null ) { bw_trace2(); $icons = bw_array_get_from( $atts, "icon,0", "menu" ); $icons = bw_as_array( $icons ); $class = bw_array_get_from( $atts, "class,1", null ); $icon = bw_array_get( $icons, 0, null ); $size = bw_array_get( $atts, 'size', 24); // Assume we're using SVG icons rather than dashicons. oik_require_lib( 'class-oik-svg-icons'); $svgicons = new OIK_SVG_icons(); $font_class = bw_dash_enqueue_font( $icon, $atts ); if ( $font_class === "svg" ) { if ( null === $tag ) { bw_dash_inline_style_svg(); } foreach ( $icons as $icon ) { //$dpath = bw_array_get( $svgicons, $icon, null ); //bw_dash_svg_icon( $icon, $font_class, $class, $dpath ); $dash = $svgicons->get_icon( $icon, $class, $size ); e( $dash ); } } else { foreach ( $icons as $icon ) { if ( !$font_class ) { $content = $icon . $content; $font_class = "texticons"; $icon = "unknown"; } //span( $class ); - temporarily added to test class=hide span( "$font_class {$font_class}-$icon $class" ); if ( $content ) { e( bw_do_shortcode( $content ) ); } //epan(); epan(); } } return( bw_ret() ); }View on GitHub
Called by
1 to 1 of 1
Invoked by
Calls
1 to 6 of 6
Call hooks
API Letters:
