Steve Taylor photo

Developer’s Custom Fields 0.8.3

The next version of my Developer’s Custom Fields plugin is available for testing, though not yet flagged as stable as an official release. You can download it from GitHub.

I’ve introduced a new options query placeholder, [PARENT_ID]. As with the existing placeholder [OBJECT_ID], the idea is that if you use this in the value of an option query parameter, it will be automatically replaced with the appropriate value.

So, say you define a select field for pages, and populate it with pages. In the options_query array you can use the post__not_in parameter and set it to array( '[PARENT_ID]' ). Then, when the field is output, the query that pulls pages in will exclude the parent of the page being edited. (You could do the same thing with [OBJECT_ID] to exclude the page being edited, too—though note that this is also controlled by the exclude_current parameter.)

In the process of adding this placeholder, I’ve completely revamped the placeholder code. This is because I’d only implemented [OBJECT_ID] for WP_Query parameters that take simple values, not arrays. Now both these placeholders can be used inside array values.

Please test on your development sites and let me know if there’s any issues!