Since version 2.5+, WordPress has had a feature known as shortcodes, it works similarly to filters, because they accept parameters (attributes) and return a result.
Well, shortcodes are extremely useful and easy to use, allowing developers to create custom content for users to add to their pages.
Next we’ll see how simple it is to add a shortcode to your theme. So we’ll get to know the
do_shortcode() function.
To use this function, just add the following code to your theme:
| |
That was another tip for the WordPress platform.
You can find more details about the do_shortcode() function in the
official WordPress Documentation.
That’s all folks, a simple function that can be very useful in your day-to-day work integrating plugins.
Questions? Leave a comment!