Example #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);
}
Example #2
0
    protected $plugin_name = 'dt_mce_plugin_shortcode_box';
    public static function get_instance()
    {
        if (!self::$instance) {
            self::$instance = new DT_Shortcode_Box();
        }
        return self::$instance;
    }
    protected function __construct()
    {
        add_shortcode($this->shortcode_name, array($this, 'shortcode'));
        add_filter('dt_get_puny_shortcodes', array($this, 'register_puny_shortcode'));
        // add shortcode button
        $tinymce_button = new DT_ADD_MCE_BUTTON($this->plugin_name, basename(dirname(__FILE__)), false);
    }
    public function shortcode($atts, $content = null)
    {
        if (!$content) {
            return '';
        }
        return '<div class="wf-container">' . do_shortcode($content) . '</div>';
    }
    public function register_puny_shortcode($puny_shortcodes = array())
    {
        $puny_shortcodes[$this->shortcode_name] = array($this, 'shortcode');
        return $puny_shortcodes;
    }
}
// create shortcode
DT_Shortcode_Box::get_instance();