true), 'objects') + get_post_types(array('_builtin' => false, 'show_ui' => true), 'objects');
foreach ($custom_types as $key => $ct) {
if (in_array($key, $hiddenPosts)) unset($custom_types[$key]);
}
$custom_types = apply_filters( 'pmxi_custom_types', $custom_types );
$sorted_cpt = array();
foreach ($custom_types as $key => $cpt){
$sorted_cpt[$key] = $cpt;
// Put users & comments & taxonomies after Pages
if ( ! empty($custom_types['page']) && $key == 'page' || empty($custom_types['page']) && $key == 'post' ){
$sorted_cpt['taxonomies'] = new stdClass();
$sorted_cpt['taxonomies']->labels = new stdClass();
$sorted_cpt['taxonomies']->labels->name = __('Taxonomies','wp_all_export_plugin');
$sorted_cpt['import_users'] = new stdClass();
$sorted_cpt['import_users']->labels = new stdClass();
$sorted_cpt['import_users']->labels->name = __('Users','wp_all_export_plugin');
break;
}
}
$order = array('shop_order', 'shop_coupon', 'shop_customer', 'product');
foreach ($order as $cpt){
if (!empty($custom_types[$cpt])) $sorted_cpt[$cpt] = $custom_types[$cpt];
}
uasort($custom_types, "wp_all_import_cmp_custom_types");
foreach ($custom_types as $key => $cpt) {
if (empty($sorted_cpt[$key])){
$sorted_cpt[$key] = $cpt;
}
}
$hidden_post_types = get_post_types(array('_builtin' => false, 'show_ui' => false), 'objects');
foreach ($hidden_post_types as $key => $ct) {
if (in_array($key, $hiddenPosts)) unset($hidden_post_types[$key]);
}
$hidden_post_types = apply_filters( 'pmxi_custom_types', $hidden_post_types );
?>