X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/f9001779751f83dc8a10e478bfecb4d8dd5f964c..5aa86a9053fb0fa15846bb60aac2fb8fdfff524a:/wp-admin/edit.php diff --git a/wp-admin/edit.php b/wp-admin/edit.php index 39424ac9..b3b6b2e8 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -1,6 +1,6 @@ true ) ) ) ) - $post_type = $_GET['post_type']; -else - wp_die( __('Invalid post type') ); - -$_GET['post_type'] = $post_type; +if ( ! $typenow ) + wp_die( __( 'Invalid post type' ) ); +$post_type = $typenow; $post_type_object = get_post_type_object( $post_type ); -if ( !current_user_can($post_type_object->cap->edit_posts) ) - wp_die(__('Cheatin’ uh?')); +if ( ! $post_type_object ) + wp_die( __( 'Invalid post type' ) ); + +if ( ! current_user_can( $post_type_object->cap->edit_posts ) ) + wp_die( __( 'Cheatin’ uh?' ) ); $wp_list_table = _get_list_table('WP_Posts_List_Table'); $pagenum = $wp_list_table->get_pagenum(); @@ -51,6 +49,8 @@ if ( $doaction ) { check_admin_referer('bulk-posts'); $sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), wp_get_referer() ); + if ( ! $sendback ) + $sendback = admin_url( $parent_file ); $sendback = add_query_arg( 'paged', $pagenum, $sendback ); if ( strpos($sendback, 'post.php') !== false ) $sendback = admin_url($post_new_file); @@ -120,13 +120,15 @@ if ( $doaction ) { $sendback = add_query_arg('deleted', $deleted, $sendback); break; case 'edit': - $done = bulk_edit_posts($_REQUEST); - - if ( is_array($done) ) { - $done['updated'] = count( $done['updated'] ); - $done['skipped'] = count( $done['skipped'] ); - $done['locked'] = count( $done['locked'] ); - $sendback = add_query_arg( $done, $sendback ); + if ( isset($_REQUEST['bulk_edit']) ) { + $done = bulk_edit_posts($_REQUEST); + + if ( is_array($done) ) { + $done['updated'] = count( $done['updated'] ); + $done['skipped'] = count( $done['skipped'] ); + $done['locked'] = count( $done['locked'] ); + $sendback = add_query_arg( $done, $sendback ); + } } break; } @@ -142,44 +144,73 @@ if ( $doaction ) { $wp_list_table->prepare_items(); -$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' ); -if ( $pagenum > $total_pages && $total_pages > 0 ) { - wp_redirect( add_query_arg( 'paged', $total_pages ) ); - exit; -} - wp_enqueue_script('inline-edit-post'); $title = $post_type_object->labels->name; if ( 'post' == $post_type ) { - add_contextual_help($current_screen, - '

' . __('You can customize the display of this screen in a number of ways:') . '

' . - '' . - '

' . __('Hovering over a row in the posts list will display action links that allow you to manage your post. You can perform the following actions:') . '

' . - '' . - '

' . __('You can also edit multiple posts at once. Select the posts you want to edit using the checkboxes, select Edit from the Bulk Actions menu and click Apply. You will be able to change the metadata (categories, author, etc.) for all selected posts at once. To remove a post from the grouping, just click the x next to its name in the Bulk Edit area that appears.') . '

' . + get_current_screen()->add_help_tab( array( + 'id' => 'overview', + 'title' => __('Overview'), + 'content' => + '

' . __('This screen provides access to all of your posts. You can customize the display of this screen to suit your workflow.') . '

' + ) ); + get_current_screen()->add_help_tab( array( + 'id' => 'screen-content', + 'title' => __('Screen Content'), + 'content' => + '

' . __('You can customize the display of this screen’s contents in a number of ways:') . '

' . + '' + ) ); + get_current_screen()->add_help_tab( array( + 'id' => 'action-links', + 'title' => __('Available Actions'), + 'content' => + '

' . __('Hovering over a row in the posts list will display action links that allow you to manage your post. You can perform the following actions:') . '

' . + '' + ) ); + get_current_screen()->add_help_tab( array( + 'id' => 'bulk-actions', + 'title' => __('Bulk Actions'), + 'content' => + '

' . __('You can also edit or move multiple posts to the trash at once. Select the posts you want to act on using the checkboxes, then select the action you want to take from the Bulk Actions menu and click Apply.') . '

' . + '

' . __('When using Bulk Edit, you can change the metadata (categories, author, etc.) for all selected posts at once. To remove a post from the grouping, just click the x next to its name in the Bulk Edit area that appears.') . '

' + ) ); + + get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . - '

' . __('Documentation on Managing Posts') . '

' . + '

' . __('Documentation on Managing Posts') . '

' . '

' . __('Support Forums') . '

' ); + } elseif ( 'page' == $post_type ) { - add_contextual_help($current_screen, - '

' . __('Pages are similar to Posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest Pages under other Pages by making one the “Parent” of the other, creating a group of Pages.') . '

' . - '

' . __('Managing Pages is very similar to managing Posts, and the screens can be customized in the same way.') . '

' . - '

' . __('You can also perform the same types of actions, including narrowing the list by using the filters, acting on a Page using the action links that appear when you hover over a row, or using the Bulk Actions menu to edit the metadata for multiple Pages at once.') . '

' . + get_current_screen()->add_help_tab( array( + 'id' => 'overview', + 'title' => __('Overview'), + 'content' => + '

' . __('Pages are similar to posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest pages under other pages by making one the “Parent” of the other, creating a group of pages.') . '

' + ) ); + get_current_screen()->add_help_tab( array( + 'id' => 'managing-pages', + 'title' => __('Managing Pages'), + 'content' => + '

' . __('Managing pages is very similar to managing posts, and the screens can be customized in the same way.') . '

' . + '

' . __('You can also perform the same types of actions, including narrowing the list by using the filters, acting on a page using the action links that appear when you hover over a row, or using the Bulk Actions menu to edit the metadata for multiple pages at once.') . '

' + ) ); + + get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . - '

' . __('Documentation on Managing Pages') . '

' . + '

' . __('Documentation on Managing Pages') . '

' . '

' . __('Support Forums') . '

' ); } @@ -190,21 +221,17 @@ require_once('./admin-header.php'); ?>
-

labels->name ); ?> labels->add_new); ?> labels->name ); ?> labels->add_new); ?> ' . __('Search results for “%s”') . '', get_search_query() ); ?>

- -

|

- - - +

' . __('Undo') . '
'; + $messages[] = '' . __('Undo') . ''; unset($_REQUEST['trashed']); } if ( isset($_REQUEST['untrashed']) && (int) $_REQUEST['untrashed'] ) { - printf( _n( 'Item restored from the Trash.', '%s items restored from the Trash.', $_REQUEST['untrashed'] ), number_format_i18n( $_REQUEST['untrashed'] ) ); + $messages[] = sprintf( _n( 'Item restored from the Trash.', '%s items restored from the Trash.', $_REQUEST['untrashed'] ), number_format_i18n( $_REQUEST['untrashed'] ) ); unset($_REQUEST['undeleted']); } +if ( $messages ) + echo join( ' ', $messages ); +unset( $messages ); + $_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed'), $_SERVER['REQUEST_URI'] ); ?>