| 42 | | $menu[5] = array( __('Posts'), 'edit_posts', 'edit.php', '', 'open-if-no-js menu-top menu-icon-post', 'menu-posts', 'div' ); |
| 43 | | $submenu['edit.php'][5] = array( __('All Posts'), 'edit_posts', 'edit.php' ); |
| 44 | | /* translators: add new post */ |
| 45 | | $submenu['edit.php'][10] = array( _x('Add New', 'post'), 'edit_posts', 'post-new.php' ); |
| | 42 | if ( in_array( 'post', get_post_types( array('show_ui' => true ) ) ) ) { |
| | 43 | $menu[5] = array( __('Posts'), 'edit_posts', 'edit.php', '', 'open-if-no-js menu-top menu-icon-post', 'menu-posts', 'div' ); |
| | 44 | $submenu['edit.php'][5] = array( __('All Posts'), 'edit_posts', 'edit.php' ); |
| | 45 | /* translators: add new post */ |
| | 46 | $submenu['edit.php'][10] = array( _x('Add New', 'post'), 'edit_posts', 'post-new.php' ); |
| 67 | | $menu[20] = array( __('Pages'), 'edit_pages', 'edit.php?post_type=page', '', 'menu-top menu-icon-page', 'menu-pages', 'div' ); |
| 68 | | $submenu['edit.php?post_type=page'][5] = array( __('All Pages'), 'edit_pages', 'edit.php?post_type=page' ); |
| 69 | | /* translators: add new page */ |
| 70 | | $submenu['edit.php?post_type=page'][10] = array( _x('Add New', 'page'), 'edit_pages', 'post-new.php?post_type=page' ); |
| 71 | | $i = 15; |
| 72 | | foreach ( get_taxonomies( array(), 'objects' ) as $tax ) { |
| 73 | | if ( ! $tax->show_ui || ! in_array('page', (array) $tax->object_type, true) ) |
| 74 | | continue; |
| | 69 | if ( in_array( 'page', get_post_types( array('show_ui' => true ) ) ) ) { |
| | 70 | $menu[20] = array( __('Pages'), 'edit_pages', 'edit.php?post_type=page', '', 'menu-top menu-icon-page', 'menu-pages', 'div' ); |
| | 71 | $submenu['edit.php?post_type=page'][5] = array( __('All Pages'), 'edit_pages', 'edit.php?post_type=page' ); |
| | 72 | /* translators: add new page */ |
| | 73 | $submenu['edit.php?post_type=page'][10] = array( _x('Add New', 'page'), 'edit_pages', 'post-new.php?post_type=page' ); |
| | 74 | $i = 15; |
| | 75 | foreach ( get_taxonomies( array(), 'objects' ) as $tax ) { |
| | 76 | if ( ! $tax->show_ui || ! in_array('page', (array) $tax->object_type, true) ) |
| | 77 | continue; |
| 76 | | $submenu['edit.php?post_type=page'][$i++] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, 'edit-tags.php?taxonomy=' . $tax->name . '&post_type=page' ); |
| | 79 | $submenu['edit.php?post_type=page'][$i++] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, 'edit-tags.php?taxonomy=' . $tax->name . '&post_type=page' ); |
| | 80 | } |
| | 81 | unset($tax); |
| | 82 | } |
| | 83 | |
| | 84 | $show_comments_menu = false; |
| | 85 | foreach ( (array) get_post_types( array( 'show_ui' => true ) ) as $ptype ) { |
| | 86 | if ( post_type_supports( $ptype, 'comments' ) ) { |
| | 87 | $show_comments_menu = true; |
| | 88 | break; |
| 80 | | $awaiting_mod = wp_count_comments(); |
| 81 | | $awaiting_mod = $awaiting_mod->moderated; |
| 82 | | $menu[25] = array( sprintf( __('Comments %s'), "<span class='awaiting-mod count-$awaiting_mod'><span class='pending-count'>" . number_format_i18n($awaiting_mod) . "</span></span>" ), 'edit_posts', 'edit-comments.php', '', 'menu-top menu-icon-comments', 'menu-comments', 'div' ); |
| 83 | | unset($awaiting_mod); |
| | 92 | if ( $show_comments_menu ) { |
| | 93 | $awaiting_mod = wp_count_comments(); |
| | 94 | $awaiting_mod = $awaiting_mod->moderated; |
| | 95 | $menu[25] = array( sprintf( __('Comments %s'), "<span class='awaiting-mod count-$awaiting_mod'><span class='pending-count'>" . number_format_i18n($awaiting_mod) . "</span></span>" ), 'edit_posts', 'edit-comments.php', '', 'menu-top menu-icon-comments', 'menu-comments', 'div' ); |
| | 96 | unset($awaiting_mod); |