基本上是wp_filter_object_list()
调用指定names
作为输出和and
作为操作员。因为你无法区分portfolio
剩下的是对象数据,您必须手动取消设置。
$cpts = get_post_types( array(
\'show_in_nav_menus\' => false
) );
unset( $cpts[\'portfolio\'] );
foreach ( $cpts as $cpt )
$r[] = get_post_type_object( $cpt );
printf(
\'<pre>%s</pre><br /><pre>%s</pre>\'
// The names only
,var_export( $cpts, true )
// The full post type objects
,var_export( $r, true )
);