Passing parameters from PHP to Javascripts in plugins » Otto on WordPress

Much cleaner. One static and unchanging JS file to cache. Parameters get put into your HTML itself as a one-liner. You can deal with the parameters using a normal PHP array before passing them over. No need to screw around with generating Javascript from PHP or looking for wp-load or even messing with tricky actions.

via Passing parameters from PHP to Javascripts in plugins » Otto on WordPress.

Author: Zack Katz

Zack Katz is the President of Katz Web Services and the developer of WordPress plugins with over 700,000 downloads. He lives in Southwest Colorado with his wife and two cats.

1 thought on “Passing parameters from PHP to Javascripts in plugins » Otto on WordPress”

Leave a Reply

Your email address will not be published. Required fields are marked *