*/ final class ACP_Markup { public function search_box() { // Set up data for user content result divs. $post_types = get_post_types( array(), 'objects' ); $taxonomies = get_taxonomies( array(), 'objects' ); $excluded_post_types = get_option('acp_excluded_post_types'); $excluded_taxonomies = get_option('acp_excluded_taxonomies'); $results_format = get_option( 'acp_display_results_by_type' ); // Unset any excluded post types if ( !empty($excluded_post_types) ) { foreach ( $post_types as $post_type_slug => $post_type_obj ) { if ( isset( $excluded_post_types[$post_type_slug] ) && '1' == $excluded_post_types[$post_type_slug] ) { unset( $post_types[$post_type_slug] ); } if ( 'post' == $post_type_slug ) { $post_type_obj->menu_icon = 'dashicons-admin-post'; } if ( 'page' == $post_type_slug ) { $post_type_obj->menu_icon = 'dashicons-admin-page'; } if ( 'attachment' == $post_type_slug ) { $post_type_obj->menu_icon = 'dashicons-admin-media'; } } } // Unset any excluded taxonomies if ( !empty($excluded_taxonomies) ) { foreach ( $taxonomies as $taxonomy_slug => $taxonomy_obj ) { if ( isset( $excluded_taxonomies[$taxonomy_slug] ) && '1' == $excluded_taxonomies[$taxonomy_slug] ) { unset( $taxonomies[$taxonomy_slug] ); } } } $user_result_lists = array_merge($post_types, $taxonomies); ?>