Super quick note on something that has been bugging me lately. If you’re using dot notation to access Javascript properties, you can’t have a property name with dashes in it (e.g. image.attributes.media_details.sizes.plugin-name-headshot
). Instead you need to use bracket notation with quotation marks. So in replace the example above with image.attributes.media_details.sizes['plugin-name-headshot']
.
Category: Code
WordPress REST API and ACF
I’m continuing to work on the plugin I’ve been talking about in my last few posts and have reached the point of front-end display. The requirements for this project are to have a quick initial page load ( for which I use native PHP) and filtering in place (for which I use the WP REST… Continue reading WordPress REST API and ACF
The cheap-n-easy way to use “templates” in WordPress plugins
I’m continuing to work on the plugin I talked about in my last post, and have gotten to the point where we’re working on the front end display of the data. I recently sat down and really dedicated myself to figuring out the WordPress Plugin Boilerplate and really like the concept of using “partials” to reuse… Continue reading The cheap-n-easy way to use “templates” in WordPress plugins
Loading custom values into ACF field default values
A plugin I’m working on requires that the user be able to set the map center for a Google Map ACF field that is associated with a custom post type. Advanced Custom Fields has a good number of filters, but I wasn’t sure going in which filter I needed to use. A quick Google lead… Continue reading Loading custom values into ACF field default values