X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/03f2fa83c13c1b532284205fa7efcab9b8b2c41f..16e7b37c7914d753890c1a05a9335f3b43751eb8:/wp-admin/edit.php diff --git a/wp-admin/edit.php b/wp-admin/edit.php index 62c70e2b..3b11eb71 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -10,10 +10,10 @@ require_once( dirname( __FILE__ ) . '/admin.php' ); if ( ! $typenow ) - wp_die( __( 'Invalid post type' ) ); + wp_die( __( 'Invalid post type.' ) ); if ( ! in_array( $typenow, get_post_types( array( 'show_ui' => true ) ) ) ) { - wp_die( __( 'You are not allowed to edit posts in this post type.' ) ); + wp_die( __( 'Sorry, you are not allowed to edit posts in this post type.' ) ); } if ( 'attachment' === $typenow ) { @@ -23,8 +23,8 @@ if ( 'attachment' === $typenow ) { } /** - * @global string $post_type - * @global object $post_type_object + * @global string $post_type + * @global WP_Post_Type $post_type_object */ global $post_type, $post_type_object; @@ -32,12 +32,12 @@ $post_type = $typenow; $post_type_object = get_post_type_object( $post_type ); if ( ! $post_type_object ) - wp_die( __( 'Invalid post type' ) ); + wp_die( __( 'Invalid post type.' ) ); if ( ! current_user_can( $post_type_object->cap->edit_posts ) ) { wp_die( '

' . __( 'Cheatin’ uh?' ) . '

' . - '

' . __( 'You are not allowed to edit posts in this post type.' ) . '

', + '

' . __( 'Sorry, you are not allowed to edit posts in this post type.' ) . '

', 403 ); } @@ -103,7 +103,7 @@ if ( $doaction ) { foreach ( (array) $post_ids as $post_id ) { if ( !current_user_can( 'delete_post', $post_id) ) - wp_die( __('You are not allowed to move this item to the Trash.') ); + wp_die( __('Sorry, you are not allowed to move this item to the Trash.') ); if ( wp_check_post_lock( $post_id ) ) { $locked++; @@ -122,7 +122,7 @@ if ( $doaction ) { $untrashed = 0; foreach ( (array) $post_ids as $post_id ) { if ( !current_user_can( 'delete_post', $post_id) ) - wp_die( __('You are not allowed to restore this item from the Trash.') ); + wp_die( __('Sorry, you are not allowed to restore this item from the Trash.') ); if ( !wp_untrash_post($post_id) ) wp_die( __('Error in restoring from Trash.') ); @@ -137,7 +137,7 @@ if ( $doaction ) { $post_del = get_post($post_id); if ( !current_user_can( 'delete_post', $post_id ) ) - wp_die( __('You are not allowed to delete this item.') ); + wp_die( __('Sorry, you are not allowed to delete this item.') ); if ( $post_del->post_type == 'attachment' ) { if ( ! wp_delete_attachment($post_id) ) @@ -162,6 +162,10 @@ if ( $doaction ) { } } break; + default: + /** This action is documented in wp-admin/edit-comments.php */ + $sendback = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $sendback, $doaction, $post_ids ); + break; } $sendback = remove_query_arg( array('action', 'action2', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view'), $sendback ); @@ -194,7 +198,7 @@ if ( 'post' == $post_type ) { '

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

' . '' @@ -221,8 +225,8 @@ if ( 'post' == $post_type ) { get_current_screen()->set_help_sidebar( '

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

' . - '

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

' . - '

' . __('Support Forums') . '

' + '

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

' . + '

' . __('Support Forums') . '

' ); } elseif ( 'page' == $post_type ) { @@ -242,8 +246,8 @@ if ( 'post' == $post_type ) { get_current_screen()->set_help_sidebar( '

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

' . - '

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

' . - '

' . __('Support Forums') . '

' + '

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

' . + '

' . __('Support Forums') . '

' ); } @@ -283,7 +287,7 @@ $bulk_messages['page'] = array( ); /** - * Filter the bulk action updated messages. + * Filters the bulk action updated messages. * * By default, custom post types use the messages for the 'post' post type. * @@ -299,14 +303,23 @@ $bulk_counts = array_filter( $bulk_counts ); require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
-

labels->name ); -if ( current_user_can( $post_type_object->cap->create_posts ) ) - echo ' ' . esc_html( $post_type_object->labels->add_new ) . ''; -if ( ! empty( $_REQUEST['s'] ) ) - printf( ' ' . __('Search results for “%s”') . '', get_search_query() ); ?>

+cap->create_posts ) ) { + echo ' ' . esc_html( $post_type_object->labels->add_new ) . ''; +} + +if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) { + /* translators: %s: search keywords */ + printf( ' ' . __( 'Search results for “%s”' ) . '', get_search_query() ); +} +?> + +
+