Javascript Helpers

Are there any WordPress specific Javascript functions that could be used as helpers when writing custom code?

I am thinking specifically of one that would pull back the base URL of your install, but any helper functions built into WordPress would be nice to know.

1 Answer
1

WordPress installs with a number of libraries/classes/plugins/etc that you can enqueue and use.

For base url specifically, or any vars in general you need to access from javascript, use the api php functions, then pass it to your javascript via wp_localize_script.

Leave a Comment