Dev log
Run a WordPress shortcode from PHP (and when not to)
Use do_shortcode() to run a shortcode in a PHP template, or call the function behind it when the shortcode is yours. Plus timing, escaping and [embed].
5 min read
Dev
Technical notes on WordPress, Shopify, PHP, JavaScript and the other tools I build with every day.
Dev log
Run a WordPress shortcode from PHP (and when not to)
Use do_shortcode() to run a shortcode in a PHP template, or call the function behind it when the shortcode is yours. Plus timing, escaping and [embed].
5 min read