I’m using Log1x’s Poet package to add a custom post type, and with that, add a few custom columns to the post type. Columns are a feature of extended-cpts, but aren’t documented in Poet, so it may be the case that it’s not possible, but I thought i’d ask to see if anyone has a suggestion.
This is the code in question
Edit: this does work fine until I run wp acorn optimize which then flags up errors.
This isn’t serialisable, so it gives me theses errors on wp acorn optimize: Your configuration files are not serializable. and Call to undefined method Closure::__set_state() .
I’ve tried using a value function: value(function() { echo 'example thing to echo'; }) which stops the error but doesn’t display in the column and i’ve also tried including the function outside of the object, which again stopped the error but doesn’t display anything.
If anyone has any suggestions i’d appreciate being pointed in the right direction
Am I missing something, or are we adding columns in the same way? For reference, i’ve pasted the full post type below – the column portion is giving me the Your configuration files are not serializable error on wp acorn optimize.
aha it’s extending an existing post type post_type: post - there’s an issue on the Poet repo from a while back with more info + workarounds. The above will work for everything except for post / page as far as I know.
Hey thanks for sending over that issue, i’ll take a look!
In this case i’m registering a custom post type called ‘our-work’, apologies the copy and paste isn’t clear, the post at the start is wrapping around the registered post types.