Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the community forum?
All Topics
mur1s

ACF Addon PostObject PHP warning

Hi, I’m getting this PHP warning when using the ACF post_object field as admin column:

In function set_post_type( $post_type ), $post_type should be an array, but it’s a string.
Best!

3 weeks, 5 days ago
Stefan
Developer

Hi there,

Can you tell me which version of ACF you’re using?
I cannot reproduce the issue with multiple settings in both the pro and free version of ACF.
Could you also send me an export of your ACF settings and Admin Columns settings to support@admincolumns.com so I can try to reproduce the issue?

3 weeks, 2 days ago
mur1s

Hey Stefan,

I’m using ACF Pro v5.7.6 and I’m creating the fields via PHP. You can define post types in ACF without using arrays (just like in WP_Query):

In that case, Admin Columns expects an array in ac-addon-acf/classes/Search/PostObject.php and shows a warning:

If you define the post type in the ACF field like this, everything works:

Best,
Muris

3 weeks, 2 days ago
Tobias
Developer

Data stored by ACF – when using the field settings page – will always return an array for post types. Apparently, that’s not the case for PHP defined fields. To solve the discrepancy we will add both options (string and array) in our next release. That will solve any warnings. Thanks for bringing it to our attention!

Best,
Tobias

3 weeks, 2 days ago
mur1s

Awesome, thank you!

Best,
Muris

3 weeks, 2 days ago

You must be logged in to reply to this topic.