soflyy/wp-all-import-action-reference

pmxi_custom_types filter

Programmer095 opened this issue · 0 comments

Used to modify Step 1 options.

Definition ( second parameter has multiple possible values 'custom_types', 'all_types', 'hiddent_types' ):
apply_filters( 'pmxi_custom_types', $custom_types, 'custom_types' );

Here's an example function that would add the 'pc_groups' custom type to the list ( only relevant if the pc_groups CPT was defined with show_ui => false ):

add_filter('pmxi_custom_types', 'wpai_wpallimport_custom_types', 10, 1);
function wpai_wpallimport_custom_types( $custom_types ){
	
	$custom_types = array_merge( $custom_types, get_post_types(array('name'=>'pc_groups'), 'objects' ));
	
	return $custom_types;
}