Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
Helen Seddon

How to display a specific post type’s posts in the inline/bulk edit field

I’ve added a column to the Product Variations post type, for a custom field I have on my variations.

I’ve got the column set as a custom field, and the field type set as ‘Post’. This works great for being able to display the name of the post in that column (based on the selected post ID that’s set in that field), but when using inline edit and bulk edit the list of posts to choose from are posts from every possible post type (rather than a specific post type that I’d like to be able to choose from).

Is there a hook/filter I can use to modify the post type that’s queried for the edit/bulk edit dropdown on this column?

Thanks,
Matt

7 months, 1 week ago
Stefan van den Dungen Gronovius
Developer

You can use the WP pre_get_post hook to alter the query.
Can you use the params of the ajax to make sure you only change the query for the right call:

action = acp_editing_request
method = inline-select-values
column = {dynamic column name}
list_screen – {dynamic list screen name} _>. you could check for ‘product_variation

7 months, 1 week ago
Helen Seddon

Many thanks! I’ll test that method out next week.

7 months, 1 week ago

You must be logged in to reply to this topic.