| 1 |
<?php |
| 2 |
|
| 3 |
/* --------------------------------------------------------- */ |
| 4 |
/* !Return an array of post types - 2.12 */ |
| 5 |
/* --------------------------------------------------------- */ |
| 6 |
|
| 7 |
if( !function_exists('mtphr_post_duplicator_post_types') ) { |
| 8 |
function mtphr_post_duplicator_post_types() { |
| 9 |
|
| 10 |
$post_types = array('same' => __('Same as original', 'post-duplicator')); |
| 11 |
$pts = get_post_types(array(), 'objects'); |
| 12 |
|
| 13 |
// Remove framework post types |
| 14 |
unset( $pts['attachment'] ); |
| 15 |
unset( $pts['revision'] ); |
| 16 |
unset( $pts['nav_menu_item'] ); |
| 17 |
unset( $pts['wooframework'] ); |
| 18 |
|
| 19 |
if( is_array($pts) && count($pts) > 0 ) { |
| 20 |
foreach( $pts as $i=>$pt ) { |
| 21 |
$post_types[$i] = $pt->labels->singular_name; |
| 22 |
} |
| 23 |
} |
| 24 |
|
| 25 |
return $post_types; |
| 26 |
} |
| 27 |
} |
| 28 |
|