ThemeForest

Improving Shortcodes with the has_shortcode()

277 posts
  • Bought between 10 and 49 items
  • Sold between 1 000 and 5 000 dollars
  • Has been a member for 0-1 years
  • Exclusive Author
  • Microlancer Beta Tester
  • Europe
greenline says

I searched a lot for something like this and it helped me a lot improving my plugins, so I am sharing it with Wordpress Plugins developers: http://wp.tutsplus.com/articles/quick-tip-improving-shortcodes-with-the-has_shortcode-function/

678 posts
  • Sold between 5 000 and 10 000 dollars
  • Exclusive Author
  • Croatia
  • Bought between 10 and 49 items
  • Has been a member for 1-2 years
OriginalEXE says

Like someone posted in the comments section, I don’t like parsing the whole content, it looks slowish.

This methos seems much better: http://scribu.net/wordpress/optimal-script-loading.html

277 posts
  • Bought between 10 and 49 items
  • Sold between 1 000 and 5 000 dollars
  • Has been a member for 0-1 years
  • Exclusive Author
  • Microlancer Beta Tester
  • Europe
greenline says

Indeed, the method you indicated is better, thanks for sharing it!

1422 posts
  • Microlancer Beta Tester
  • Author had a File in an Envato Bundle
  • Bought between 50 and 99 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 3-4 years
  • Sold between 100 000 and 250 000 dollars
+2 more
ZoomIt says

Just write wp_enqueue_script inside the add_shortcode function, the script will get loaded at the end of the < body > if the shortcode has been called

All problems solved

by
by
by
by
by