samedi 3 janvier 2015

apply_filters('the_content', $content) vs do_shortcode($content)


Lets say I have a theme option or custom postmeta text area. Now I want to execute multiple shortcodes, general texts, images etc.


What will be best practice and why?


Option 1:



$content = //my text area data;
echo apply_filters('the_content', $content);


Option 2:



$content = //my text area data;
echo do_shortcode($content);


Kindly explain me which one will be best practice and why.





Aucun commentaire:

Enregistrer un commentaire