Beispiel #1
0
/**
 * Some shortcodes triks.
 * From: http://www.viper007bond.com/2009/11/22/wordpress-code-earlier-shortcodes/
 */
function dt_get_puny_shortcodes()
{
    $puny_shortcodes = array('dt_gap' => array(DT_Shortcode_Gap::get_instance(), 'shortcode'), 'dt_divider' => array(DT_Shortcode_Divider::get_instance(), 'shortcode'), 'dt_stripe' => array(DT_Shortcode_Stripe::get_instance(), 'shortcode'), 'dt_box' => array(DT_Shortcode_Box::get_instance(), 'shortcode'), 'dt_cell' => array(DT_Shortcode_Columns::get_instance(), 'shortcode_cell'), 'dt_code' => array(DT_Shortcode_Code::get_instance(), 'shortcode_prepare'), 'dt_toggle' => array(DT_Shortcode_Toggles::get_instance(), 'shortcode'), 'dt_item' => array(DT_Shortcode_Accordion::get_instance(), 'shortcode_item'), 'dt_benefits' => array(DT_Shortcode_Benefits::get_instance(), 'shortcode_benefits'), 'dt_benefit' => array(DT_Shortcode_Benefits::get_instance(), 'shortcode_benefit'), 'dt_progress_bars' => array(DT_Shortcode_ProgressBars::get_instance(), 'shortcode_bars'), 'dt_progress_bar' => array(DT_Shortcode_ProgressBars::get_instance(), 'shortcode_bar'), 'dt_button' => array(DT_Shortcode_Button::get_instance(), 'shortcode'), 'dt_teaser' => array(DT_Shortcode_Teaser::get_instance(), 'shortcode'), 'dt_call_to_action' => array(DT_Shortcode_CallToAction::get_instance(), 'shortcode'), 'dt_fancy_image' => array(DT_Shortcode_FancyImage::get_instance(), 'shortcode'), 'dt_list_item' => array(DT_Shortcode_List::get_instance(), 'shortcode_item'), 'dt_list' => array(DT_Shortcode_List::get_instance(), 'shortcode_list'), 'dt_quote' => array(DT_Shortcode_Quote::get_instance(), 'shortcode'), 'dt_banner' => array(DT_Shortcode_Banner::get_instance(), 'shortcode'), 'dt_accordion' => array(DT_Shortcode_Accordion::get_instance(), 'shortcode_accordion'), 'dt_text' => array(DT_Shortcode_AnimatedText::get_instance(), 'shortcode'), 'dt_social_icons' => array(DT_Shortcode_SocialIcons::get_instance(), 'shortcode_icons_content'), 'dt_social_icon' => array(DT_Shortcode_SocialIcons::get_instance(), 'shortcode_icon'), 'dt_vc_list_item' => array(DT_Shortcode_List_Vc::get_instance(), 'shortcode_item'), 'dt_vc_list' => array(DT_Shortcode_List_Vc::get_instance(), 'shortcode_list'));
    if (function_exists('vc_is_inline') && vc_is_inline()) {
        $puny_shortcodes = array();
    }
    return apply_filters('dt_get_puny_shortcodes', $puny_shortcodes);
}
Beispiel #2
0
            if ($this->atts['text_color']) {
                $banner_inner_style[] = 'outline-color: ' . $this->atts['text_color'];
            }
            $banner_inner_height = $this->atts['min_height'] - $this->atts['inner_padding'];
            $banner_inner_style[] = 'height: ' . $banner_inner_height . 'px';
            return 'style="' . esc_attr(implode(';', $banner_inner_style)) . '"';
        }
        protected function get_bg_inline_style()
        {
            $banner_bg_style = array();
            $padding = $this->atts['outer_padding'] > $this->atts['border_width'] ? $this->atts['outer_padding'] : $this->atts['border_width'];
            $banner_bg_style[] = 'padding: ' . $padding . 'px';
            $banner_bg_style[] = 'min-height: ' . $this->atts['min_height'] . 'px';
            return 'style="' . esc_attr(implode(';', $banner_bg_style)) . '"';
        }
        protected function get_link()
        {
            $link = '';
            if ($this->atts['link']) {
                if ($this->atts['target_blank']) {
                    $link = sprintf(' onclick="window.open(\'%s\');"', $this->atts['link']);
                } else {
                    $link = sprintf(' onclick="window.location.href=\'%s\';"', $this->atts['link']);
                }
            }
            return $link;
        }
    }
    // create shortcode
    DT_Shortcode_Banner::get_instance();
}