<content>

The WordPress Core content shortcode.


Usage

  1. // assign value 
  2. $content = 'dynamic_tag'; 
  3.  
  4. // basic usage 
  5. echo do_shortcode("[$content]"); 
  1. // assign value 
  2. $content = 'dynamic_tag'; 
  3.  
  4. // variable usage 
  5. $result = do_shortcode("[$content]"); 
  6. echo $result;  

Defined (29)

The shortcode is defined in the following location(s).

/inc/core/widget.php  
  1. extract( $args ); 
  2. $title = apply_filters( 'widget_title', $instance['title'] ); 
  3. $content = $instance['content']; 
  4. echo $before_widget; 
  5. if ( $title ) echo $before_title . $title . $after_title; 
  6. echo '<div class="textwidget">' . do_shortcode( $content ) . '</div>'; 
  7. echo $after_widget; 
  8.  
  9. function update( $new_instance, $old_instance ) { 
  10. $instance = $old_instance; 
/inc/core/tools.php  
  1. /* 
  2. * @return string Formatted content 
  3. */ 
  4. function su_do_shortcode( $content, $pre ) { 
  5. if ( strpos( $content, '[_' ) !== false ) $content = preg_replace( '@(\[_*)_(' . $pre . '|/)@', "$1$2", $content ); 
  6. return do_shortcode( $content ); 
  7.  
  8. /** 
  9. * Shortcode names prefix in compatibility mode 
/inc/core/shortcodes.php  
  1. 'margin' => '20',  
  2. 'class' => '' 
  3. ), $atts, 'heading' ); 
  4. su_query_asset( 'css', 'su-content-shortcodes' ); 
  5. do_action( 'su/shortcode/heading', $atts ); 
  6. return '<div class="su-heading su-heading-style-' . $atts['style'] . ' su-heading-align-' . $atts['align'] . su_ecssc( $atts ) . '" style="font-size:' . intval( $atts['size'] ) . 'px;margin-bottom:' . $atts['margin'] . 'px"><div class="su-heading-inner">' . do_shortcode( $content ) . '</div></div>'; 
  7.  
  8. public static function tabs( $atts = null, $content = null ) { 
  9. $atts = shortcode_atts( array( 
  10. 'active' => 1,  
  1. 'vertical' => 'no',  
  2. 'style' => 'default', // 3.x 
  3. 'class' => '' 
  4. ), $atts, 'tabs' ); 
  5. if ( $atts['style'] === '3' ) $atts['vertical'] = 'yes'; 
  6. do_shortcode( $content ); 
  7. $return = ''; 
  8. $tabs = $panes = array(); 
  9. if ( is_array( self::$tabs ) ) { 
  10. if ( self::$tab_count < $atts['active'] ) $atts['active'] = self::$tab_count; 
  11. foreach ( self::$tabs as $tab ) { 
  1. 'class' => '' 
  2. ), $atts, 'tab' ); 
  3. $x = self::$tab_count; 
  4. self::$tabs[$x] = array( 
  5. 'title' => $atts['title'],  
  6. 'content' => do_shortcode( $content ),  
  7. 'disabled' => ( $atts['disabled'] === 'yes' ) ? ' su-tabs-disabled' : '',  
  8. 'anchor' => ( $atts['anchor'] ) ? ' data-anchor="' . str_replace( array( ' ', '#' ), '', sanitize_text_field( $atts['anchor'] ) ) . '"' : '',  
  9. 'url' => ' data-url="' . $atts['url'] . '"',  
  10. 'target' => ' data-target="' . $atts['target'] . '"',  
  11. 'class' => $atts['class'] 
  1. su_query_asset( 'css', 'font-awesome' ); 
  2. su_query_asset( 'css', 'su-box-shortcodes' ); 
  3. su_query_asset( 'js', 'jquery' ); 
  4. su_query_asset( 'js', 'su-other-shortcodes' ); 
  5. do_action( 'su/shortcode/spoiler', $atts ); 
  6. return '<div class="su-spoiler su-spoiler-style-' . $atts['style'] . ' su-spoiler-icon-' . $atts['icon'] . su_ecssc( $atts ) . '"' . $atts['anchor'] . '><div class="su-spoiler-title"><span class="su-spoiler-icon"></span>' . su_scattr( $atts['title'] ) . '</div><div class="su-spoiler-content su-clearfix" style="display:none">' . su_do_shortcode( $content, 's' ) . '</div></div>'; 
  7.  
  8. public static function accordion( $atts = null, $content = null ) { 
  9. $atts = shortcode_atts( array( 'class' => '' ), $atts, 'accordion' ); 
  10. do_action( 'su/shortcode/accordion', $atts ); 
  1.  
  2. public static function accordion( $atts = null, $content = null ) { 
  3. $atts = shortcode_atts( array( 'class' => '' ), $atts, 'accordion' ); 
  4. do_action( 'su/shortcode/accordion', $atts ); 
  5. return '<div class="su-accordion' . su_ecssc( $atts ) . '">' . do_shortcode( $content ) . '</div>'; 
  6.  
  7. public static function divider( $atts = null, $content = null ) { 
  8. $atts = shortcode_atts( array( 
  9. 'top' => 'yes',  
  1. 'color' => '#000000',  
  2. 'class' => '' 
  3. ), $atts, 'highlight' ); 
  4. if ( $atts['bg'] !== null ) $atts['background'] = $atts['bg']; 
  5. su_query_asset( 'css', 'su-content-shortcodes' ); 
  6. return '<span class="su-highlight' . su_ecssc( $atts ) . '" style="background:' . $atts['background'] . ';color:' . $atts['color'] . '"> ' . do_shortcode( $content ) . ' </span>'; 
  7.  
  8. public static function label( $atts = null, $content = null ) { 
  9. $atts = shortcode_atts( array( 
  10. 'type' => 'default',  
  1. 'style' => null, // 3.x 
  2. 'class' => '' 
  3. ), $atts, 'label' ); 
  4. if ( $atts['style'] !== null ) $atts['type'] = $atts['style']; 
  5. su_query_asset( 'css', 'su-content-shortcodes' ); 
  6. return '<span class="su-label su-label-type-' . $atts['type'] . su_ecssc( $atts ) . '">' . do_shortcode( $content ) . '</span>'; 
  7.  
  8. public static function quote( $atts = null, $content = null ) { 
  9. $atts = shortcode_atts( array( 
  10. 'style' => 'default',  
  1. : $atts['cite']; 
  2. $cite = ( $atts['cite'] ) ? '<span class="su-quote-cite">' . $cite_link . '</span>' : ''; 
  3. $cite_class = ( $atts['cite'] ) ? ' su-quote-has-cite' : ''; 
  4. su_query_asset( 'css', 'su-box-shortcodes' ); 
  5. do_action( 'su/shortcode/quote', $atts ); 
  6. return '<div class="su-quote su-quote-style-' . $atts['style'] . $cite_class . su_ecssc( $atts ) . '"><div class="su-quote-inner su-clearfix">' . do_shortcode( $content ) . su_scattr( $cite ) . '</div></div>'; 
  7.  
  8. public static function pullquote( $atts = null, $content = null ) { 
  9. $atts = shortcode_atts( array( 
  10. 'align' => 'left',  
  1. $atts = shortcode_atts( array( 
  2. 'align' => 'left',  
  3. 'class' => '' 
  4. ), $atts, 'pullquote' ); 
  5. su_query_asset( 'css', 'su-box-shortcodes' ); 
  6. return '<div class="su-pullquote su-pullquote-align-' . $atts['align'] . su_ecssc( $atts ) . '">' . do_shortcode( $content ) . '</div>'; 
  7.  
  8. public static function dropcap( $atts = null, $content = null ) { 
  9. $atts = shortcode_atts( array( 
  10. 'style' => 'default',  
  1. ), $atts, 'dropcap' ); 
  2. $atts['style'] = str_replace( array( '1', '2', '3' ), array( 'default', 'light', 'default' ), $atts['style'] ); // 3.x 
  3. // Calculate font-size 
  4. $em = $atts['size'] * 0.5 . 'em'; 
  5. su_query_asset( 'css', 'su-content-shortcodes' ); 
  6. return '<span class="su-dropcap su-dropcap-style-' . $atts['style'] . su_ecssc( $atts ) . '" style="font-size:' . $em . '">' . do_shortcode( $content ) . '</span>'; 
  7.  
  8. public static function frame( $atts = null, $content = null ) { 
  9. $atts = shortcode_atts( array( 
  10. 'style' => 'default',  
  1. 'align' => 'left',  
  2. 'class' => '' 
  3. ), $atts, 'frame' ); 
  4. su_query_asset( 'css', 'su-content-shortcodes' ); 
  5. su_query_asset( 'js', 'su-other-shortcodes' ); 
  6. return '<span class="su-frame su-frame-align-' . $atts['align'] . ' su-frame-style-' . $atts['style'] . su_ecssc( $atts ) . '"><span class="su-frame-inner">' . do_shortcode( $content ) . '</span></span>'; 
  7.  
  8. public static function row( $atts = null, $content = null ) { 
  9. $atts = shortcode_atts( array( 'class' => '' ), $atts ); 
  10. return '<div class="su-row' . su_ecssc( $atts ) . '">' . su_do_shortcode( $content, 'r' ) . '</div>'; 
  1. return '<span class="su-frame su-frame-align-' . $atts['align'] . ' su-frame-style-' . $atts['style'] . su_ecssc( $atts ) . '"><span class="su-frame-inner">' . do_shortcode( $content ) . '</span></span>'; 
  2.  
  3. public static function row( $atts = null, $content = null ) { 
  4. $atts = shortcode_atts( array( 'class' => '' ), $atts ); 
  5. return '<div class="su-row' . su_ecssc( $atts ) . '">' . su_do_shortcode( $content, 'r' ) . '</div>'; 
  6.  
  7. public static function column( $atts = null, $content = null ) { 
  8. $atts = shortcode_atts( array( 
  9. 'size' => '1/2',  
  1. 'class' => '' 
  2. ), $atts, 'column' ); 
  3. if ( $atts['last'] !== null && $atts['last'] == '1' ) $atts['class'] .= ' su-column-last'; 
  4. if ( $atts['center'] === 'yes' ) $atts['class'] .= ' su-column-centered'; 
  5. su_query_asset( 'css', 'su-box-shortcodes' ); 
  6. return '<div class="su-column su-column-size-' . str_replace( '/', '-', $atts['size'] ) . su_ecssc( $atts ) . '"><div class="su-column-inner su-clearfix">' . su_do_shortcode( $content, 'c' ) . '</div></div>'; 
  7.  
  8. public static function su_list( $atts = null, $content = null ) { 
  9. $atts = shortcode_atts( array( 
  10. 'icon' => 'icon: star',  
  1. $atts['icon'] = '<i class="fa fa-' . trim( str_replace( 'icon:', '', $atts['icon'] ) ) . '" style="color:' . $atts['icon_color'] . '"></i>'; 
  2. su_query_asset( 'css', 'font-awesome' ); 
  3. else $atts['icon'] = '<img src="' . $atts['icon'] . '" alt="" />'; 
  4. su_query_asset( 'css', 'su-content-shortcodes' ); 
  5. return '<div class="su-list su-list-style-' . $atts['style'] . su_ecssc( $atts ) . '">' . str_replace( '<li>', '<li>' . $atts['icon'] . ' ', su_do_shortcode( $content, 'l' ) ) . '</div>'; 
  6.  
  7. public static function button( $atts = null, $content = null ) { 
  8. $atts = shortcode_atts( array( 
  9. 'url' => get_option( 'home' ),  
  1. // Uploaded icon 
  2. else { 
  3. $atts['icon'] = '<img src="' . $atts['icon'] . '" width="' . $atts['size'] . '" height="' . $atts['size'] . '" alt="' . $atts['title'] . '" />'; 
  4. su_query_asset( 'css', 'su-box-shortcodes' ); 
  5. return '<div class="su-service' . su_ecssc( $atts ) . '"><div class="su-service-title" style="padding-' . $rtl . ':' . round( $atts['size'] + 14 ) . 'px;min-height:' . $atts['size'] . 'px;line-height:' . $atts['size'] . 'px">' . $atts['icon'] . ' ' . su_scattr( $atts['title'] ) . '</div><div class="su-service-content su-clearfix" style="padding-' . $rtl . ':' . round( $atts['size'] + 14 ) . 'px">' . do_shortcode( $content ) . '</div></div>'; 
  6.  
  7. public static function box( $atts = null, $content = null ) { 
  8. $atts = shortcode_atts( array( 
  9. 'title' => __( 'This is box title', 'shortcodes-ultimate' ),  
  1. $radius = ( $atts['radius'] != '0' ) ? 'border-radius:' . $atts['radius'] . 'px;-moz-border-radius:' . $atts['radius'] . 'px;-webkit-border-radius:' . $atts['radius'] . 'px;' : ''; 
  2. $title_radius = ( $atts['radius'] != '0' ) ? $atts['radius'] - 1 : ''; 
  3. $title_radius = ( $title_radius ) ? '-webkit-border-top-left-radius:' . $title_radius . 'px;-webkit-border-top-right-radius:' . $title_radius . 'px;-moz-border-radius-topleft:' . $title_radius . 'px;-moz-border-radius-topright:' . $title_radius . 'px;border-top-left-radius:' . $title_radius . 'px;border-top-right-radius:' . $title_radius . 'px;' : ''; 
  4. su_query_asset( 'css', 'su-box-shortcodes' ); 
  5. // Return result 
  6. return '<div class="su-box su-box-style-' . $atts['style'] . su_ecssc( $atts ) . '" style="border-color:' . su_hex_shift( $atts['box_color'], 'darker', 20 ) . ';' . $radius . '"><div class="su-box-title" style="background-color:' . $atts['box_color'] . ';color:' . $atts['title_color'] . ';' . $title_radius . '">' . su_scattr( $atts['title'] ) . '</div><div class="su-box-content su-clearfix">' . su_do_shortcode( $content, 'b' ) . '</div></div>'; 
  7.  
  8. public static function note( $atts = null, $content = null ) { 
  9. $atts = shortcode_atts( array( 
  10. 'note_color' => '#FFFF66',  
  1. if ( $atts['color'] !== null ) $atts['note_color'] = $atts['color']; 
  2. if ( $atts['background'] !== null ) $atts['note_color'] = $atts['background']; 
  3. // Prepare border-radius 
  4. $radius = ( $atts['radius'] != '0' ) ? 'border-radius:' . $atts['radius'] . 'px;-moz-border-radius:' . $atts['radius'] . 'px;-webkit-border-radius:' . $atts['radius'] . 'px;' : ''; 
  5. su_query_asset( 'css', 'su-box-shortcodes' ); 
  6. return '<div class="su-note' . su_ecssc( $atts ) . '" style="border-color:' . su_hex_shift( $atts['note_color'], 'darker', 10 ) . ';' . $radius . '"><div class="su-note-inner su-clearfix" style="background-color:' . $atts['note_color'] . ';border-color:' . su_hex_shift( $atts['note_color'], 'lighter', 80 ) . ';color:' . $atts['text_color'] . ';' . $radius . '">' . su_do_shortcode( $content, 'n' ) . '</div></div>'; 
  7.  
  8. public static function expand( $atts = null, $content = null ) { 
  9. $atts = shortcode_atts( array( 
  10. 'more_text' => __( 'Show more', 'shortcodes-ultimate' ),  
  1. if ( $more_icon || $less_icon ) su_query_asset( 'css', 'font-awesome' ); 
  2. // Prepare less link 
  3. $less = ( $atts['hide_less'] !== 'yes' ) ? '<div class="su-expand-link su-expand-link-less" style="text-align:' . $atts['link_align'] . '"><a href="javascript:;" style="color:' . $atts['link_color'] . ';border-color:' . $atts['link_color'] . '">' . $less_icon . '<span style="border-color:' . $atts['link_color'] . '">' . $atts['less_text'] . '</span></a></div>' : ''; 
  4. su_query_asset( 'css', 'su-box-shortcodes' ); 
  5. su_query_asset( 'js', 'su-other-shortcodes' ); 
  6. return '<div class="su-expand su-expand-collapsed su-expand-link-style-' . $atts['link_style'] . su_ecssc( $atts ) . '" data-height="' . $atts['height'] . '"><div class="su-expand-content" style="color:' . $atts['text_color'] . ';max-height:' . intval( $atts['height'] ) . 'px;overflow:hidden">' . do_shortcode( $content ) . '</div><div class="su-expand-link su-expand-link-more" style="text-align:' . $atts['link_align'] . '"><a href="javascript:;" style="color:' . $atts['link_color'] . ';border-color:' . $atts['link_color'] . '">' . $more_icon . '<span style="border-color:' . $atts['link_color'] . '">' . $atts['more_text'] . '</span></a></div>' . $less . '</div>'; 
  7.  
  8. public static function lightbox( $atts = null, $content = null ) { 
  9. $atts = shortcode_atts( array( 
  10. 'src' => false,  
  1. if ( !$atts['src'] ) return Su_Tools::error( __FUNCTION__, __( 'please specify correct source', 'shortcodes-ultimate' ) ); 
  2. su_query_asset( 'css', 'magnific-popup' ); 
  3. su_query_asset( 'js', 'jquery' ); 
  4. su_query_asset( 'js', 'magnific-popup' ); 
  5. su_query_asset( 'js', 'su-other-shortcodes' ); 
  6. return '<span class="su-lightbox' . su_ecssc( $atts ) . '" data-mfp-src="' . su_scattr( $atts['src'] ) . '" data-mfp-type="' . $atts['type'] . '">' . do_shortcode( $content ) . '</span>'; 
  7.  
  8. public static function lightbox_content( $atts = null, $content = null ) { 
  9. $atts = shortcode_atts( array( 
  10. 'id' => '',  
  1. 'shadow' => '0px 0px 15px #333333',  
  2. 'class' => '' 
  3. ), $atts, 'lightbox_content' ); 
  4. su_query_asset( 'css', 'su-box-shortcodes' ); 
  5. if ( !$atts['id'] ) return Su_Tools::error( __FUNCTION__, __( 'please specify correct ID for this block. You should use same ID as in the Content source field (when inserting lightbox shortcode)', 'shortcodes-ultimate' ) ); 
  6. $return = '<div class="su-lightbox-content ' . su_ecssc( $atts ) . '" id="' . trim( $atts['id'], '#' ) . '" style="display:none;width:' . $atts['width'] . ';margin-top:' . $atts['margin'] . 'px;margin-bottom:' . $atts['margin'] . 'px;padding:' . $atts['padding'] . 'px;background-color:' . $atts['background'] . ';color:' . $atts['color'] . ';box-shadow:' . $atts['shadow'] . ';text-align:' . $atts['text_align'] . '">' . do_shortcode( $content ) . '</div>'; 
  7. if ( did_action( 'su/generator/preview/before' ) ) return '<div class="su-lightbox-content-preview">' . $return . '</div>'; 
  8. else return $return; 
  9.  
  10. public static function tooltip( $atts = null, $content = null ) { 
  1. su_query_asset( 'css', 'qtip' ); 
  2. su_query_asset( 'css', 'su-other-shortcodes' ); 
  3. su_query_asset( 'js', 'jquery' ); 
  4. su_query_asset( 'js', 'qtip' ); 
  5. su_query_asset( 'js', 'su-other-shortcodes' ); 
  6. return '<span class="su-tooltip' . su_ecssc( $atts ) . '" data-close="' . $atts['close'] . '" data-behavior="' . $atts['behavior'] . '" data-my="' . $position['my'] . '" data-at="' . $position['at'] . '" data-classes="' . implode( ' ', $classes ) . '" data-title="' . $atts['title'] . '" title="' . esc_attr( $atts['content'] ) . '">' . do_shortcode( $content ) . '</span>'; 
  7.  
  8. public static function su_private( $atts = null, $content = null ) { 
  9. $atts = shortcode_atts( array( 'class' => '' ), $atts, 'private' ); 
  10. su_query_asset( 'css', 'su-other-shortcodes' ); 
  1.  
  2. public static function su_private( $atts = null, $content = null ) { 
  3. $atts = shortcode_atts( array( 'class' => '' ), $atts, 'private' ); 
  4. su_query_asset( 'css', 'su-other-shortcodes' ); 
  5. return ( current_user_can( 'publish_posts' ) ) ? '<div class="su-private' . su_ecssc( $atts ) . '"><div class="su-private-shell">' . do_shortcode( $content ) . '</div></div>' : ''; 
  6.  
  7. public static function media( $atts = null, $content = null ) { 
  8. // Check YouTube video 
  9. if ( strpos( $atts['url'], 'youtu' ) !== false ) return Su_Shortcodes::youtube( $atts ); 
  1. $atts = shortcode_atts( array( 
  2. 'url' => false,  
  3. 'class' => '' 
  4. ), $atts, 'table' ); 
  5. $return = '<div class="su-table' . su_ecssc( $atts ) . '">'; 
  6. $return .= ( $atts['url'] ) ? su_parse_csv( $atts['url'] ) : do_shortcode( $content ); 
  7. $return .= '</div>'; 
  8. su_query_asset( 'css', 'su-content-shortcodes' ); 
  9. su_query_asset( 'js', 'jquery' ); 
  10. su_query_asset( 'js', 'su-other-shortcodes' ); 
  11. return $return; 
  1. $login = '<a href="' . esc_attr( $atts['login_url'] ) . '">' . $atts['login_text'] . '</a>'; 
  2. su_query_asset( 'css', 'su-other-shortcodes' ); 
  3. return '<div class="su-members' . su_ecssc( $atts ) . '" style="background-color:' . su_hex_shift( $atts['color'], 'lighter', 50 ) . ';border-color:' .su_hex_shift( $atts['color'], 'darker', 20 ) . ';color:' .su_hex_shift( $atts['color'], 'darker', 60 ) . '">' . str_replace( '%login%', $login, su_scattr( $atts['message'] ) ) . '</div>'; 
  4. // Return original content 
  5. else return do_shortcode( $content ); 
  6.  
  7. public static function guests( $atts = null, $content = null ) { 
  8. $atts = shortcode_atts( array( 'class' => '' ), $atts, 'guests' ); 
  9. $return = ''; 
  1. public static function guests( $atts = null, $content = null ) { 
  2. $atts = shortcode_atts( array( 'class' => '' ), $atts, 'guests' ); 
  3. $return = ''; 
  4. if ( !is_user_logged_in() && !is_null( $content ) ) { 
  5. su_query_asset( 'css', 'su-other-shortcodes' ); 
  6. $return = '<div class="su-guests' . su_ecssc( $atts ) . '">' . do_shortcode( $content ) . '</div>'; 
  7. return $return; 
  8.  
  9. public static function feed( $atts = null, $content = null ) { 
  1. 'inline' => 'no',  
  2. 'class' => '' 
  3. ), $atts, 'animate' ); 
  4. $tag = ( $atts['inline'] === 'yes' ) ? 'span' : 'div'; 
  5. $time = '-webkit-animation-duration:' . $atts['duration'] . 's;-webkit-animation-delay:' . $atts['delay'] . 's;animation-duration:' . $atts['duration'] . 's;animation-delay:' . $atts['delay'] . 's;'; 
  6. $return = '<' . $tag . ' class="su-animate' . su_ecssc( $atts ) . '" style="visibility:hidden;' . $time . '" data-animation="' . $atts['type'] . '" data-duration="' . $atts['duration'] . '" data-delay="' . $atts['delay'] . '">' . do_shortcode( $content ) . '</' . $tag . '>'; 
  7. su_query_asset( 'css', 'animate' ); 
  8. su_query_asset( 'js', 'jquery' ); 
  9. su_query_asset( 'js', 'inview' ); 
  10. su_query_asset( 'js', 'su-other-shortcodes' ); 
  11. return $return; 
  1. $years = Su_Tools::range( $atts['years'] ); 
  2. // Check current year 
  3. if ( !in_array( $now, $years ) ) return $atts['alt']; 
  4. // Return result (all check passed) 
  5. return do_shortcode( $content ); 
  6.  
  7.  
  8. new Su_Shortcodes;