We are using toolset_get_related_post and would like to specify the post status of the posts this function should return us.
How can we do this?
toolset_get_related_post will Retrieve an ID of a single related post.
That posts post_status can be defined in the function, so if you want a specific status, you would have to specify it.
You should pass an array of post status values or a string with one or more statuses separated by commas.
The passed statuses need to be among the values returned by get_post_statuses() or added by the toolset_accepted_post_statuses_for_api filter.
$role_name_to_return = '';//parent or child $args = array();// see args array - Additional query arguments. $post_status = 'publish,draft';//you can only use those from https://developer.wordpress.org/reference/functions/get_post_statuses/ or passed to toolset_accepted_post_statuses_for_api $writer = toolset_get_related_post( $post_id, array( 'one-side', 'other-side' ), $role_name_to_return, $args, $post_status );
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.