Open turtlepod opened 6 months ago
There's a filter to add non-existing post type to the pull option. https://10up.github.io/distributor/dt_available_pull_post_types.html
But it's not working because this filter results is compared to the distributable_post_types() function which uses post_type_exists check.
distributable_post_types()
post_type_exists
Summary:
dt_available_pull_post_types Filter: https://github.com/10up/distributor/blob/develop/includes/utils.php#L274-L283
dt_available_pull_post_types
$pull_post_types = apply_filters( 'dt_available_pull_post_types', $post_types, $remote_post_types, $local_post_types, $connection, $type ); if ( ! empty( $pull_post_types ) ) { $post_types = array(); foreach ( $pull_post_types as $post_type ) { if ( in_array( $post_type['slug'], $distributable_post_types, true ) ) { $post_types[] = $post_type; } } }
distributable_post_types Function: https://github.com/10up/distributor/blob/develop/includes/utils.php#L325
distributable_post_types
$post_types = array_filter( $post_types, 'post_type_exists' );
n/a - see description
WP 6.4.3 / Distributor 2.0.3
Describe the bug
There's a filter to add non-existing post type to the pull option. https://10up.github.io/distributor/dt_available_pull_post_types.html
But it's not working because this filter results is compared to the
distributable_post_types()
function which usespost_type_exists
check.Summary:
post_type_exists
dt_available_pull_post_types
Filter: https://github.com/10up/distributor/blob/develop/includes/utils.php#L274-L283distributable_post_types
Function: https://github.com/10up/distributor/blob/develop/includes/utils.php#L325Steps to Reproduce
post_type_exists
Screenshots, screen recording, code snippet
n/a - see description
Environment information
WP 6.4.3 / Distributor 2.0.3
WordPress information
WP 6.4.3 / Distributor 2.0.3
Code of Conduct