Enclavely / tailor

Build beautiful page layouts quickly and easily using your favourite WordPress theme.
https://www.tailorwp.com
GNU General Public License v3.0
1.05k stars 102 forks source link

Ghost shortcode #141

Open reefki opened 7 years ago

reefki commented 7 years ago

Currently, we have to register the shortcode when registering element but if we register the element within a theme then it's a fault based on theme check plugin because using add_shortcode function is plugin territory.

This change makes it easier to create a custom element directly from a theme without having to register the shortcode just what Visual Composer plugin does.

To render the shortcode just simply add filter to tailor_render_element_shortcode_{TAG}, example:

function render_custom_shortcode($default, $atts, $content = '') {
    // do stuff here
}

add_filter('tailor_render_element_shortcode_custom', 'render_custom_shortcode', 10, 3);