esc_html__( 'Previous', $themename ),
'next' => esc_html__( 'Next', $themename )
) );
}
function et_add_simple_buttons(){
wp_print_scripts( 'quicktags' );
$output = "";
echo $output;
}
add_shortcode('digg', 'et_digg');
function et_digg($atts, $content = null) {
$output = "
";
return $output;
}
add_shortcode('stumble','et_stumble');
function et_stumble($atts, $content = null){
$output = "";
return $output;
}
add_shortcode('facebook','et_facebook');
function et_facebook($atts, $content = null){
$output = "Share";
return $output;
}
add_shortcode('twitter','et_twitter');
function et_twitter($atts, $content = null){
extract(shortcode_atts(array(
"name" => 'name'
), $atts, 'twitter'));
$output = "";
return $output;
}
add_shortcode('feedburner','et_feedburner');
function et_feedburner($atts, $content = null){
extract(shortcode_atts(array(
"name" => 'name'
), $atts, 'feedburner'));
$output = "
";
return $output;
}
add_shortcode('retweet','et_retweet');
function et_retweet($atts, $content = null){
global $themename;
$output = "";
return $output;
}
add_shortcode('protected','et_protected');
function et_protected($atts, $content = null){
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) {
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) {
global $themename;
extract(shortcode_atts(array(
"text" => esc_html__( 'Add a Tooltip Text', $themename ),
"id" => '',
"class" => ''
), $atts, 'tooltip'));
wp_enqueue_script( 'et-shortcodes-js' );
$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) {
global $themename;
extract(shortcode_atts(array(
"caption" => esc_html__( 'Click here to learn more', $themename ),
"state" => 'close',
"id" => '',
"class" => ''
), $atts, 'learn_more'));
wp_enqueue_script( 'et-shortcodes-js' );
$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) {
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) {
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) {
extract(shortcode_atts(array(
"fx" => 'fade',
"auto" => 'no',
"autospeed" => '5000',
"id" => '',
"slidertype" => 'top tabs',
"class" => ''
), $atts, 'tabs'));
wp_enqueue_script( 'et-shortcodes-js' );
$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 = "
";
} elseif ($slidertype == 'simple') {
$class .= ' et_slidertype_simple';
$output = "
";
} elseif ($slidertype == 'images') {
$class .= ' et_slidertype_images';
$output = "
";
}
return $output;
}
add_shortcode('tabcontainer', 'et_tabcontainer');
function et_tabcontainer($atts, $content = null) {
$content = et_content_helper($content);
$output = "
";
return $output;
}
add_shortcode('imagetabcontainer', 'et_imagetabcontainer');
function et_imagetabcontainer($atts, $content = null) {
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 = "
";
return $output;
}
add_shortcode('imagetabtext', 'et_imagetabtext');
function et_imagetabtext($atts, $content = null) {
$content = et_content_helper($content);
$output = "
{$content}
";
return $output;
}
add_shortcode('tabtext', 'et_tabtext');
function et_tabtext($atts, $content = null) {
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) {
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 = "
";
return $output;
}
add_shortcode('tab', 'et_tab');
function et_tab($atts, $content = null) {
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) {
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 = "
";
return $output;
}
add_shortcode('author', 'et_author');
function et_author($atts, $content = null) {
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 = "
";
return $output;
}
add_shortcode('author_image', 'et_author_image');
function et_author_image($atts, $content = null) {
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) {
$content = et_content_helper($content);
$output = "
{$content}
";
return $output;
}
add_shortcode('pricing_table', 'et_pricing_table');
function et_pricing_table($atts, $content = null) {
wp_enqueue_script( 'et-shortcodes-js' );
$content = et_content_helper($content);
$output = "
{$content}
";
return $output;
}
add_shortcode('custom_list', 'et_custom_list');
function et_custom_list($atts, $content = null) {
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) {
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 ) . "
" . 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) {
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) {
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) {
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 = "
";
}
$output = "
{$image_markup}
{$author}
{$company}
{$content}
";
return $output;
}
add_shortcode('quote','et_quote');
function et_quote($atts, $content = null) {
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='') {
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 );
}
}
add_action('admin_init', 'et_init_shortcodes');
function et_init_shortcodes(){
if ( current_user_can( 'edit_posts' ) && current_user_can( 'edit_pages' ) ) {
if ( in_array(basename($_SERVER['PHP_SELF']), array('post-new.php', 'page-new.php', 'post.php', 'page.php') ) ) {
add_filter('mce_buttons', 'et_filter_mce_button');
add_filter('mce_external_plugins', 'et_filter_mce_plugin');
add_action('admin_head','et_add_simple_buttons');
add_action('edit_form_advanced', 'et_advanced_buttons');
add_action('edit_page_form', 'et_advanced_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; ?>