Passing Data from PHP to JavaScript
When passing data between PHP and JavaScript in WordPress, two methods can help. Use wp_add_inline_script to easily pass any data and perform dynamic code logic. Then, access the data from a single file to limit global variable access and allow easy inline documentation.
WP-CLI Command to Manage Orphan Data and Metadata
Last week, when I was in between projects, I decided to take one day and draft up a WP-CLI command that allows for listing and deleting orphan WordPress entities, as well as metadata. I had the idea for this quite a while ago, and I tried to get it into WP-CLI. That failed, however, as […]
Using HTML5 Data Attributes
HTML5 introduced custom data attributes. In this post, I discuss how to efficiently work with data attributes in both JavaScript as well as PHP context.