Changeset 12702
- Timestamp:
- 01/12/2010 12:14:27 AM (15 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-header.php
r12625 r12702 56 56 <?php 57 57 58 if ( in_array( $pagenow, array('post.php', 'post-new.php', 'page.php' , 'page-new.php') ) ) {58 if ( in_array( $pagenow, array('post.php', 'post-new.php', 'page.php') ) ) { 59 59 add_action( 'admin_print_footer_scripts', 'wp_tiny_mce', 25 ); 60 60 wp_enqueue_script('quicktags'); -
trunk/wp-admin/edit-pages.php
r12616 r12702 19 19 20 20 if ( strpos($sendback, 'page.php') !== false ) 21 $sendback = admin_url('p age-new.php');21 $sendback = admin_url('post-new.php?post_type=page'); 22 22 23 23 if ( isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) { … … 142 142 <div class="wrap"> 143 143 <?php screen_icon(); ?> 144 <h2><?php echo esc_html( $title ); ?> <a href="p age-new.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'page'); ?></a> <?php144 <h2><?php echo esc_html( $title ); ?> <a href="post-new.php?post_type=page" class="button add-new-h2"><?php echo esc_html_x('Add New', 'page'); ?></a> <?php 145 145 if ( isset($_GET['s']) && $_GET['s'] ) 146 146 printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( get_search_query() ) ); ?> -
trunk/wp-admin/includes/post.php
r12616 r12702 325 325 * @since unknown 326 326 * 327 *@param string A post type string, defaults to 'post'. 327 328 * @return object stdClass object containing all the default post data as attributes 328 329 */ 329 function get_default_post_to_edit( ) {330 function get_default_post_to_edit( $post_type = 'post' ) { 330 331 331 332 $post_title = ''; … … 348 349 $post->post_password = ''; 349 350 $post->post_status = 'draft'; 350 $post->post_type = 'post';351 $post->post_type = $post_type; 351 352 $post->to_ping = ''; 352 353 $post->pinged = ''; -
trunk/wp-admin/includes/template.php
r12694 r12702 749 749 */ 750 750 function wp_manage_posts_columns() { 751 global $typenow; 752 751 753 $posts_columns = array(); 752 754 $posts_columns['cb'] = '<input type="checkbox" />'; … … 754 756 $posts_columns['title'] = _x('Post', 'column name'); 755 757 $posts_columns['author'] = __('Author'); 756 $posts_columns['categories'] = __('Categories'); 757 $posts_columns['tags'] = __('Tags'); 758 if ( empty($typenow) || is_object_in_taxonomy($typenow, 'category') ) 759 $posts_columns['categories'] = __('Categories'); 760 if ( empty($typenow) || is_object_in_taxonomy($typenow, 'category') ) 761 $posts_columns['tags'] = __('Tags'); 758 762 $post_status = !empty($_REQUEST['post_status']) ? $_REQUEST['post_status'] : 'all'; 759 if ( !in_array( $post_status, array('pending', 'draft', 'future') ) )763 if ( !in_array( $post_status, array('pending', 'draft', 'future') ) && ( empty($typenow) || post_type_supports($typenow, 'comments') ) ) 760 764 $posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="images/comment-grey-bubble.png" /></div>'; 761 765 $posts_columns['date'] = __('Date'); … … 827 831 $_wp_column_headers = array(); 828 832 833 $map_screen = $page; 834 $type = str_replace('edit-', '', $map_screen); 835 if ( in_array($type, get_post_types()) ) 836 $map_screen = 'edit'; 837 829 838 // Store in static to avoid running filters on each call 830 839 if ( isset($_wp_column_headers[$page]) ) 831 840 return $_wp_column_headers[$page]; 832 841 833 switch ($ page) {842 switch ($map_screen) { 834 843 case 'edit': 835 844 $_wp_column_headers[$page] = wp_manage_posts_columns(); … … 925 934 $hidden = get_hidden_columns($type); 926 935 $styles = array(); 927 // $styles['tag']['posts'] = 'width: 90px;';928 // $styles['link-category']['links'] = 'width: 90px;';929 // $styles['category']['posts'] = 'width: 90px;';930 // $styles['link']['visible'] = 'text-align: center;';931 936 932 937 foreach ( $columns as $column_key => $column_display_name ) { … … 3495 3500 $screen = $typenow; 3496 3501 } 3502 if ( 'edit' == $screen ) { 3503 if ( !empty($typenow) ) 3504 $screen = 'edit-' . $typenow; 3505 } 3497 3506 3498 3507 if ( isset($meta_screens[$screen]) ) … … 3708 3717 3709 3718 function screen_options($screen) { 3710 switch ( $screen ) { 3719 $map_screen = $screen; 3720 $type = str_replace('edit-', '', $map_screen); 3721 if ( in_array($type, get_post_types()) ) 3722 $map_screen = 'edit'; 3723 3724 switch ( $map_screen ) { 3711 3725 case 'edit': 3712 3726 $per_page_label = __('Posts per page:'); -
trunk/wp-admin/menu.php
r12694 r12702 72 72 $submenu['edit-pages.php'][5] = array( __('Edit'), 'edit_pages', 'edit-pages.php' ); 73 73 /* translators: add new page */ 74 $submenu['edit-pages.php'][10] = array( _x('Add New', 'page'), 'edit_pages', 'p age-new.php' );74 $submenu['edit-pages.php'][10] = array( _x('Add New', 'page'), 'edit_pages', 'post-new.php?post_type=page' ); 75 75 76 76 $menu[25] = array( sprintf( __('Comments %s'), "<span id='awaiting-mod' class='count-$awaiting_mod'><span class='pending-count'>" . number_format_i18n($awaiting_mod) . "</span></span>" ), 'edit_posts', 'edit-comments.php', '', 'menu-top', 'menu-comments', 'div' ); -
trunk/wp-admin/page.php
r12695 r12702 74 74 75 75 $sendback = wp_get_referer(); 76 if ( strpos($sendback, 'page.php') !== false || strpos($sendback, 'p age-new.php') !== false )76 if ( strpos($sendback, 'page.php') !== false || strpos($sendback, 'post-new.php') !== false ) 77 77 $sendback = admin_url('edit-pages.php'); 78 78 else -
trunk/wp-admin/post-new.php
r12597 r12702 10 10 require_once('admin.php'); 11 11 12 if ( isset($_GET['post_type']) && in_array( $_GET['post_type'], get_post_types( array('_show' => true) ) ) )12 if ( isset($_GET['post_type']) && ( in_array( $_GET['post_type'], get_post_types( array('_show' => true ) ) ) || in_array( $_GET['post_type'], get_post_types( array('_builtin' => true ) ) ) ) ) 13 13 $post_type = $_GET['post_type']; 14 14 else … … 18 18 $parent_file = "edit.php?post_type=$post_type"; 19 19 $submenu_file = "post-new.php?post_type=$post_type"; 20 if ( 'page' == $post_type ) 21 $parent_file = 'edit-pages.php'; 20 22 } else { 21 23 $parent_file = 'edit.php'; … … 36 38 wp_enqueue_script('word-count'); 37 39 38 if ( !current_user_can('edit_posts') ) {40 if ( 'post' == $post_type && !current_user_can('edit_posts') ) { 39 41 require_once ('./admin-header.php'); ?> 40 42 <div class="wrap"> … … 50 52 51 53 // Show post form. 52 $post = get_default_post_to_edit(); 53 $post->post_type = $post_type; 54 include('edit-form-advanced.php'); 54 if ( current_user_can('edit_' . $post_type_object->capability_type . 's') ) { 55 $post = get_default_post_to_edit( $post_type ); 56 include('edit-form-advanced.php'); 57 } 55 58 56 59 include('admin-footer.php');
Note: See TracChangeset
for help on using the changeset viewer.