\n /* 'raw', 'options' => array( 'display_name' => 'raw', 'open_tag' => '\n[raw]', 'close_tag' => '[/raw]\n', 'key' => '' )); $buttons[] = array('name' => 'one_half', 'options' => array( 'display_name' => 'one half', 'open_tag' => '\n[one_half]', 'close_tag' => '[/one_half]\n', 'key' => '' )); $buttons[] = array('name' => 'one_half_last', 'options' => array( 'display_name' => 'one half last', 'open_tag' => '\n[one_half_last]', 'close_tag' => '[/one_half_last]\n', 'key' => '' )); $buttons[] = array('name' => 'one_third', 'options' => array( 'display_name' => 'one third', 'open_tag' => '\n[one_third]', 'close_tag' => '[/one_third]\n', 'key' => '' )); $buttons[] = array('name' => 'one_third_last', 'options' => array( 'display_name' => 'one third last', 'open_tag' => '\n[one_third_last]', 'close_tag' => '[/one_third_last]\n', 'key' => '' )); $buttons[] = array('name' => 'one_fourth', 'options' => array( 'display_name' => 'one fourth', 'open_tag' => '\n[one_fourth]', 'close_tag' => '[/one_fourth]\n', 'key' => '' )); $buttons[] = array('name' => 'one_fourth_last', 'options' => array( 'display_name' => 'one fourth last', 'open_tag' => '\n[one_fourth_last]', 'close_tag' => '[/one_fourth_last]\n', 'key' => '' )); $buttons[] = array('name' => 'two_third', 'options' => array( 'display_name' => 'two third', 'open_tag' => '\n[two_third]', 'close_tag' => '[/two_third]\n', 'key' => '' )); $buttons[] = array('name' => 'two_third_last', 'options' => array( 'display_name' => 'two third last', 'open_tag' => '\n[two_third_last]', 'close_tag' => '[/two_third_last]\n', 'key' => '' )); $buttons[] = array('name' => 'three_fourth', 'options' => array( 'display_name' => 'three fourth', 'open_tag' => '\n[three_fourth]', 'close_tag' => '[/three_fourth]\n', 'key' => '' )); $buttons[] = array('name' => 'three_fourth_last', 'options' => array( 'display_name' => 'three fourth last', 'open_tag' => '\n[three_fourth_last]', 'close_tag' => '[/three_fourth_last]\n', 'key' => '' )); $buttons[] = array('name' => 'three_fourth_last', 'options' => array( 'display_name' => 'three fourth last', 'open_tag' => '\n[three_fourth_last]', 'close_tag' => '[/three_fourth_last]\n', 'key' => '' )); $buttons[] = array('name' => 'box', 'options' => array( 'display_name' => 'box', 'open_tag' => '\n[box type="shadow"]', 'close_tag' => '[/box]\n', 'key' => '' )); $buttons[] = array('name' => 'tooltip', 'options' => array( 'display_name' => 'tooltip', 'open_tag' => '[tooltip text="Tooltip Text"]', 'close_tag' => '[/tooltip]', 'key' => '' )); $buttons[] = array('name' => 'learn_more', 'options' => array( 'display_name' => 'learn_more', 'open_tag' => '\n[learn_more caption="Click here to learn more"]', 'close_tag' => '[/learn_more]\n', 'key' => '' )); $buttons[] = array('name' => 'slider', 'options' => array( 'display_name' => 'slider', 'open_tag' => '\n[slider]', 'close_tag' => '[/slider]\n', 'key' => '' )); $buttons[] = array('name' => 'slide', 'options' => array( 'display_name' => 'slide', 'open_tag' => '\n[slide]', 'close_tag' => '[/slide]\n', 'key' => '' )); $buttons[] = array('name' => 'button', 'options' => array( 'display_name' => 'button', 'open_tag' => '\n[button link="#"]', 'close_tag' => '[/button]\n', 'key' => '' )); $buttons[] = array('name' => 'digg', 'options' => array( 'display_name' => 'digg', 'open_tag' => '\n[digg]', 'close_tag' => '[/digg]\n', 'key' => '' )); $buttons[] = array('name' => 'stumble', 'options' => array( 'display_name' => 'stumble', 'open_tag' => '\n[stumble]', 'close_tag' => '[/stumble]\n', 'key' => '' )); $buttons[] = array('name' => 'facebook', 'options' => array( 'display_name' => 'facebook', 'open_tag' => '\n[facebook]', 'close_tag' => '[/facebook]\n', 'key' => '' )); $buttons[] = array('name' => 'twitter', 'options' => array( 'display_name' => 'twitter', 'open_tag' => '\n[twitter name="name"]', 'close_tag' => '[/twitter]\n', 'key' => '' )); $buttons[] = array('name' => 'retweet', 'options' => array( 'display_name' => 'retweet', 'open_tag' => '\n[retweet]', 'close_tag' => '[/retweet]\n', 'key' => '' )); $buttons[] = array('name' => 'feedburner', 'options' => array( 'display_name' => 'feedburner', 'open_tag' => '\n[feedburner name="name"]', 'close_tag' => '[/feedburner]\n', 'key' => '' )); $buttons[] = array('name' => 'protected', 'options' => array( 'display_name' => 'protected', 'open_tag' => '\n[protected]', 'close_tag' => '[/protected]\n', 'key' => '' )); for ($i=0; $i <= (count($buttons)-1); $i++) { $output .= "edButtons[edButtons.length] = new edButton('ed_{$buttons[$i]['name']}' ,'{$buttons[$i]['options']['display_name']}' ,'{$buttons[$i]['options']['open_tag']}' ,'{$buttons[$i]['options']['close_tag']}' ,'{$buttons[$i]['options']['key']}' ); \n"; } $output .= "\n /* ]]> */ \n "; echo et_core_esc_previously( $output ); } add_shortcode('digg', 'et_digg'); function et_digg($atts, $content = null) { do_action( 'et_do_legacy_shortcode' ); $output = " "; return $output; } add_shortcode('stumble','et_stumble'); function et_stumble($atts, $content = null){ do_action( 'et_do_legacy_shortcode' ); $output = ""; // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript return $output; } add_shortcode('facebook','et_facebook'); function et_facebook($atts, $content = null){ do_action( 'et_do_legacy_shortcode' ); $output = "Share"; // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript return $output; } add_shortcode('twitter','et_twitter'); function et_twitter($atts, $content = null){ do_action( 'et_do_legacy_shortcode' ); extract(shortcode_atts(array( "name" => 'name' ), $atts, 'twitter')); $output = ""; // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript return $output; } add_shortcode('feedburner','et_feedburner'); function et_feedburner($atts, $content = null){ do_action( 'et_do_legacy_shortcode' ); extract(shortcode_atts(array( "name" => 'name' ), $atts, 'feedburner')); $output = " "; return $output; } add_shortcode('retweet','et_retweet'); function et_retweet($atts, $content = null){ do_action( 'et_do_legacy_shortcode' ); global $themename; $output = "" . esc_html__( 'Tweet', $themename ) . ""; // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript return $output; } add_shortcode('protected','et_protected'); function et_protected($atts, $content = null){ do_action( 'et_do_legacy_shortcode' ); global $themename, $user_login; if ( is_user_logged_in() ) { $content = et_content_helper($content); $output = $content; } else { $scheme = apply_filters( 'et_forms_scheme', null ); $output = "
" . esc_html__('Member Login',$themename) . "

"; } return $output; } add_shortcode('box', 'et_box'); function et_box($atts, $content = null) { do_action( 'et_do_legacy_shortcode' ); extract(shortcode_atts(array( "type" => 'shadow', "id" => '', "class" => '' ), $atts, 'box')); $content = et_content_helper($content); $id = ($id !== '') ? " id='" . esc_attr( $id ) . "'" : ''; $class = ($class !== '') ? esc_attr( ' ' . $class ) : ''; $output = "
"; $output .= do_shortcode($content); $output .= "
"; return $output; } add_shortcode('tooltip', 'et_tooltip'); function et_tooltip($atts, $content = null) { do_action( 'et_do_legacy_shortcode' ); global $themename; extract(shortcode_atts(array( "text" => esc_html__( 'Add a Tooltip Text', $themename ), "id" => '', "class" => '' ), $atts, 'tooltip')); $content = et_content_helper($content); $id = ($id !== '') ? " id='" . esc_attr( $id ) . "'" : ''; $class = ($class !== '') ? esc_attr( ' ' . $class ) : ''; $output = "{$content}{$text}"; return $output; } add_shortcode('learn_more', 'et_learnmore'); function et_learnmore($atts, $content = null) { do_action( 'et_do_legacy_shortcode' ); global $themename; extract(shortcode_atts(array( "caption" => esc_html__( 'Click here to learn more', $themename ), "state" => 'close', "id" => '', "class" => '' ), $atts, 'learn_more')); $content = et_content_helper($content); $id = ($id !== '') ? " id='" . esc_attr( $id ) . "'" : ''; $class = ($class !== '') ? esc_attr( ' ' . $class ) : ''; $divClass = ($state === 'close') ? 'et-learn-more' : 'et-learn-more et-open'; $hClass = ($state === 'close') ? 'heading-more' : 'heading-more open'; $divClass .= ' clearfix'; $output = "

" . esc_html( $caption ) . "

{$content}
"; return $output; } add_shortcode('button', 'et_button'); function et_button($atts, $content = null) { do_action( 'et_do_legacy_shortcode' ); extract(shortcode_atts(array( "link" => "#", "color" => "blue", "type" => "small", "icon" => "download", "newwindow" => "no", "id" => '', "class" => '', "br" => 'no' ), $atts, 'button')); $output = ''; $target = ($newwindow === 'yes') ? ' target="_blank"' : ''; $content = et_content_helper($content); $id = ($id !== '') ? " id='" . esc_attr( $id ) . "'" : ''; if ($type === 'small') $output .= "{$content}"; if ($type === 'big') $output .= "{$content}"; if ($type === 'icon') $output .= "{$content}"; if ( $br === 'yes' ) $output .= '
'; return $output; } add_shortcode('slide', 'et_slide'); function et_slide($atts, $content = null) { do_action( 'et_do_legacy_shortcode' ); extract(shortcode_atts(array( "id" => '', "class" => '' ), $atts, 'slide')); $content = et_content_helper($content); $id = ($id !== '') ? " id='" . esc_attr( $id ) . "'" : ''; $class = ($class !== '') ? esc_attr( ' ' . $class ) : ''; $output = " {$content} "; return $output; } add_shortcode('tabs', 'et_tabs'); function et_tabs($atts, $content = null) { do_action( 'et_do_legacy_shortcode' ); extract(shortcode_atts(array( "fx" => 'fade', "auto" => 'no', "autospeed" => '5000', "id" => '', "slidertype" => 'top tabs', "class" => '' ), $atts, 'tabs')); $auto = ( $auto === 'no' ) ? 'false' : 'true'; $content = et_content_helper($content); $id = ( '' !== $id ) ? " id='" . esc_attr( $id ) . "'" : ''; $class = ($class !== '') ? " {$class}" : ''; $class .= " et_sliderfx_{$fx}" . " et_sliderauto_{$auto}" . " et_sliderauto_speed_{$autospeed}"; if ($slidertype === 'top tabs') { $class .= ' et_slidertype_top_tabs'; $output = "
{$content}
"; } elseif ($slidertype === 'left tabs') { $class .= ' et_slidertype_left_tabs clearfix'; $output = "
{$content}
"; } elseif ($slidertype === 'simple') { $class .= ' et_slidertype_simple'; $output = "
{$content}
"; } elseif ($slidertype === 'images') { $class .= ' et_slidertype_images'; $output = "
{$content}
"; } return $output; } add_shortcode('tabcontainer', 'et_tabcontainer'); function et_tabcontainer($atts, $content = null) { do_action( 'et_do_legacy_shortcode' ); $content = et_content_helper($content); $output = "
    {$content}
"; return $output; } add_shortcode('imagetabcontainer', 'et_imagetabcontainer'); function et_imagetabcontainer($atts, $content = null) { do_action( 'et_do_legacy_shortcode' ); global $themename; extract(shortcode_atts(array( "id" => '', "class" => '' ), $atts, 'imagetabcontainer')); $content = et_content_helper($content); $id = ($id !== '') ? " id='" . esc_attr( $id ) . "'" : ''; $class = ($class !== '') ? esc_attr( ' ' . $class ) : ''; $previous = esc_html__( 'Previous', $themename ); $next = esc_html__( 'Next', $themename ); $output = "
{$previous} {$content} {$next}
"; return $output; } add_shortcode('imagetabtext', 'et_imagetabtext'); function et_imagetabtext($atts, $content = null) { do_action( 'et_do_legacy_shortcode' ); $content = et_content_helper($content); $output = " {$content} "; return $output; } add_shortcode('tabtext', 'et_tabtext'); function et_tabtext($atts, $content = null) { do_action( 'et_do_legacy_shortcode' ); extract(shortcode_atts(array( "id" => '', "class" => '' ), $atts, 'tabtext')); $content = et_content_helper($content); $id = ($id !== '') ? " id='" . esc_attr( $id ) . "'" : ''; $class = ($class !== '') ? esc_attr( ' ' . $class ) : ''; $output = " {$content} "; return $output; } add_shortcode('tabcontent', 'et_tabcontent'); function et_tabcontent($atts, $content = null) { do_action( 'et_do_legacy_shortcode' ); extract(shortcode_atts(array( "id" => '', "class" => '' ), $atts, 'tabcontent')); $content = et_content_helper($content); $id = ($id !== '') ? " id='" . esc_attr( $id ) . "'" : ''; $class = ($class !== '') ? esc_attr( ' ' . $class ) : ''; $output = "
{$content}
"; return $output; } add_shortcode('tab', 'et_tab'); function et_tab($atts, $content = null) { do_action( 'et_do_legacy_shortcode' ); extract(shortcode_atts(array( "id" => '', "class" => '' ), $atts, 'tab')); $content = et_content_helper($content); $id = ($id !== '') ? " id='" . esc_attr( $id ) . "'" : ''; $class = ($class !== '') ? esc_attr( ' ' . $class ) : ''; $output = " {$content} "; return $output; } add_shortcode('imagetab', 'et_imagetab'); function et_imagetab($atts, $content = null) { do_action( 'et_do_legacy_shortcode' ); extract(shortcode_atts(array( "width" => '', "height" => '', "id" => '', "class" => '', "link" => '', "newwindow" => '', "alt" => '' ), $atts, 'imagetab')); $target = '' !== $newwindow ? ' target="_blank"' : ''; $content = et_content_helper($content); $id = ($id !== '') ? " id='" . esc_attr( $id ) . "'" : ''; $class = ($class !== '') ? esc_attr( ' ' . $class ) : ''; $output = " " . ( '' !== $link ? "" : '' ) . et_new_thumb_resize( $content, $width, $height, $alt ) . " " . ( '' !== $link ? '' : '' ) . ""; return $output; } add_shortcode('author', 'et_author'); function et_author($atts, $content = null) { do_action( 'et_do_legacy_shortcode' ); extract(shortcode_atts(array( 'id' => '', 'class' => '', 'name' => '', 'description' => '' ), $atts, 'author')); $content = et_content_helper($content); $id = ($id !== '') ? " id='" . esc_attr( $id ) . "'" : ''; $class = ($class !== '') ? esc_attr( ' ' . $class ) : ''; $output = "
{$content}
"; return $output; } add_shortcode('author_image', 'et_author_image'); function et_author_image($atts, $content = null) { do_action( 'et_do_legacy_shortcode' ); extract(shortcode_atts(array( "timthumb" => 'on' ), $atts, 'author_image')); $content = et_content_helper($content); $src = ($timthumb === 'on') ? ( et_new_thumb_resize( $content, 60, 60, '', $forstyle = true ) ) : $content; $output = "
"; return $output; } add_shortcode('author_info', 'et_author_info'); function et_author_info($atts, $content = null) { do_action( 'et_do_legacy_shortcode' ); $content = et_content_helper($content); $output = "
{$content}
"; return $output; } add_shortcode('pricing_table', 'et_pricing_table'); function et_pricing_table($atts, $content = null) { do_action( 'et_do_legacy_shortcode' ); $content = et_content_helper($content); $output = "
{$content}
"; return $output; } add_shortcode('custom_list', 'et_custom_list'); function et_custom_list($atts, $content = null) { do_action( 'et_do_legacy_shortcode' ); extract(shortcode_atts(array( "type" => 'checkmark' ), $atts, 'custom_list')); $content = et_content_helper($content); $type = ( $type !== 'checkmark' ) ? ' etlist-' . $type : ''; $output = "
{$content}
"; return $output; } add_shortcode('pricing', 'et_pricing'); function et_pricing($atts, $content = null) { do_action( 'et_do_legacy_shortcode' ); global $themename; extract(shortcode_atts(array( "price" => '19.95', "title" => "professional", "desc" => "", "url" => "#", "window" => "", "moretext" => esc_html__( 'Join Now', $themename ), "type" => "small", "currency" => "$" ), $atts, 'pricing')); $content = et_content_helper($content); $separator_sign = ( strpos($price, '.') !== false ) ? '.' : ','; $price_array = explode($separator_sign, $price); $link_target = ( $window === 'new' ) ? ' target="_blank"' : ''; $type = ( $type === 'big' ) ? ' pricing-big' : ''; $output = "

" . esc_html( $title ) . "

" . esc_html( $desc ) . "

    {$content}
" . esc_html( $currency ) . "" . esc_html( $price_array[0] ) . "" . esc_html( $price_array[1] ) . "
" . esc_html( $moretext ) . "
"; return $output; } add_shortcode('feature', 'et_pricing_feature'); function et_pricing_feature($atts, $content = null) { do_action( 'et_do_legacy_shortcode' ); extract(shortcode_atts(array( "checkmark" => 'normal' ), $atts, 'feature')); $content = et_content_helper($content); $class = ( $checkmark === 'x' ) ? ' class="x-mark"' : ''; $output = "{$content}"; return $output; } add_shortcode('dropcap', 'et_dropcap'); function et_dropcap($atts, $content = null) { do_action( 'et_do_legacy_shortcode' ); extract(shortcode_atts(array( 'style' => '', 'id' => '', 'class' => '' ), $atts, 'dropcap')); $content = et_content_helper($content); $style = ( $style !== '' ) ? ' style="' . esc_attr( $style ) . '"' : ''; $id = ($id !== '') ? " id='" . esc_attr( $id ) . "'" : ''; $class = ($class !== '') ? esc_attr( ' ' . $class ) : ''; $output = "{$content}"; return $output; } add_shortcode('testimonial', 'et_testimonial'); function et_testimonial($atts, $content = null) { do_action( 'et_do_legacy_shortcode' ); extract(shortcode_atts(array( 'style' => '', 'id' => '', 'class' => '', 'author' => '', 'company' => '', 'image' => '', 'timthumb' => 'on' ), $atts, 'testimonial')); $content = et_content_helper($content); $style = ( $style !== '' ) ? ' style="' . esc_attr( $style ) . '"' : ''; $id = ($id !== '') ? " id='" . esc_attr( $id ) . "'" : ''; $class = ($class !== '') ? esc_attr( ' ' . $class ) : ''; $orig_name = $author; $author = ( $author !== '' ) ? "" . esc_html( $author ) . "" : ''; $company = ( $company !== '' ) ? "" . esc_html( $company ) . "" : ''; $image_markup = ''; if ( $image !== '' ) { $image = ( $timthumb === 'on' ) ? et_new_thumb_resize( $image, 60, 60, '', $forstyle = true ) : $image; $image_markup = "
" . esc_attr( $orig_name ) . "
"; } $output = "
{$image_markup} {$author} {$company}
{$content}
"; return $output; } add_shortcode('quote','et_quote'); function et_quote( $atts, $content = null ) { do_action( 'et_do_legacy_shortcode' ); if ( function_exists( 'bbpress' ) && function_exists( 'gdbbx_render_the_bbcode' ) ) { // compat for gdbbpress tools plugin. if ( isset( $atts['quote'] ) && ! empty( $atts['quote'] ) ) { $output = gdbbx_render_the_bbcode( 'quote', $atts, $content ); if ( $output !== false ) { return $output; } } } extract(shortcode_atts(array( 'style' => '', 'id' => '', 'class' => '', 'type' => 'normal' ), $atts, 'quote')); $content = et_content_helper($content); $style = ( $style !== '' ) ? ' style="' . esc_attr( $style ) . '"' : ''; $id = ($id !== '') ? " id='" . esc_attr( $id ) . "'" : ''; $class = ($class !== '') ? esc_attr( ' ' . $class ) : ''; if ( $type === 'center' ) $class = ' quote-center'; $output = "
{$content} " . ( 'center' === $type ? "" : '' ) . "
"; return $output; } add_shortcode('one_half', 'et_columns'); add_shortcode('one_half_last', 'et_columns'); add_shortcode('one_third', 'et_columns'); add_shortcode('one_third_last', 'et_columns'); add_shortcode('one_fourth', 'et_columns'); add_shortcode('one_fourth_last', 'et_columns'); add_shortcode('two_third', 'et_columns'); add_shortcode('two_third_last', 'et_columns'); add_shortcode('three_fourth', 'et_columns'); add_shortcode('three_fourth_last', 'et_columns'); function et_columns($atts, $content = null, $name='') { do_action( 'et_do_legacy_shortcode' ); extract(shortcode_atts(array( "id" => '', "class" => '' ), $atts, $name)); $content = et_content_helper($content); $id = ($id !== '') ? " id='" . esc_attr( $id ) . "'" : ''; $pos = strpos($name,'_last'); if($pos !== false) $name = str_replace('_last',' et_column_last',$name); $output = " {$content} "; if($pos !== false) $output .= "
"; return $output; } if ( ! function_exists( 'et_paragraph_br_fix' ) ){ function et_paragraph_br_fix($content,$paragraph_tag=false,$br_tag=false){ $content = preg_replace('#^<\/p>|^
|

$#', '', $content); $content = preg_replace('#
#', '', $content); if ( $paragraph_tag ) $content = preg_replace('#

|

#', '', $content); return trim($content); } } if ( ! function_exists( 'et_content_helper' ) ){ function et_content_helper($content,$paragraph_tag=false,$br_tag=false){ return et_paragraph_br_fix( do_shortcode(shortcode_unautop($content)), $paragraph_tag, $br_tag ); } } // Hook later into the request lifecycle so that we can check Gutenberg status. // 'wp' is not run on edit pages so we use the next best thing. add_action( 'admin_head', 'et_init_shortcodes' ); function et_init_shortcodes() { $is_edit_url = in_array( basename( $_SERVER['PHP_SELF'] ), array( 'post-new.php', 'page-new.php', 'post.php', 'page.php' ) ); if ( ! is_admin() || ! $is_edit_url || ! current_user_can( 'edit_posts' ) || ! current_user_can( 'edit_pages' ) || et_core_is_gutenberg_enabled() ) { return; } add_filter('mce_buttons', 'et_filter_mce_button'); add_filter('mce_external_plugins', 'et_filter_mce_plugin'); add_action('edit_form_advanced', 'et_advanced_buttons'); add_action('edit_page_form', 'et_advanced_buttons'); et_add_simple_buttons(); } function et_filter_mce_button($buttons) { array_push( $buttons, '|', 'et_learn_more', 'et_box', 'et_button', 'et_tabs', 'et_author' ); return $buttons; } function et_filter_mce_plugin($plugins) { $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min'; $plugins['et_quicktags'] = get_template_directory_uri(). "/epanel/shortcodes/js/editor_plugin{$suffix}.js"; return $plugins; } function et_advanced_buttons(){ global $themename; ?>