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 creator of GravityView and the President of Katz Web Services. He lives in Denver with his wife and cute beast of a cat.

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 *