From 4a93285747f377253ac988626d9f50a3b6b31734 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 25 Sep 2008 21:12:33 +0000 Subject: [PATCH] Add colmn headrs and actions to bottom of posts table git-svn-id: http://svn.automattic.com/wordpress/trunk@8981 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-post-rows.php | 5 +++++ wp-admin/edit.php | 33 ++++++++++++++++++++++++--------- wp-admin/js/inline-edit.js | 9 +++++++++ wp-includes/script-loader.php | 2 +- 4 files changed, 39 insertions(+), 10 deletions(-) diff --git a/wp-admin/edit-post-rows.php b/wp-admin/edit-post-rows.php index a28676064b..115d81109d 100644 --- a/wp-admin/edit-post-rows.php +++ b/wp-admin/edit-post-rows.php @@ -28,4 +28,9 @@ if ( have_posts() ) { } // end if ( have_posts() ) ?> + + + + + diff --git a/wp-admin/edit.php b/wp-admin/edit.php index 8a3f3261e2..0583782847 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -9,11 +9,17 @@ /** WordPress Administration Bootstrap */ require_once('admin.php'); +$action = -1; +if ( isset($_GET['action2']) && $_GET['action2'] != -1 ) + $action = $_GET['action2']; +if ( isset($_GET['action']) && $_GET['action'] != -1 ) + $action = $_GET['action']; + // Handle bulk actions -if ( isset($_GET['action']) && $_GET['action'] != -1 ) { - switch ( $_GET['action'] ) { +if ( $action != -1 ) { + switch ( $action ) { case 'delete': - if ( isset($_GET['post']) && isset($_GET['doaction']) ) { + if ( isset($_GET['post']) && (isset($_GET['doaction']) || isset($_GET['doaction2'])) ) { check_admin_referer('bulk-posts'); foreach( (array) $_GET['post'] as $post_id_del ) { $post_del = & get_post($post_id_del); @@ -265,12 +271,6 @@ do_action('restrict_manage_posts'); - - - - -
-
$page_links
"; ?> +
+ +
+
+ + + + + + +

diff --git a/wp-admin/js/inline-edit.js b/wp-admin/js/inline-edit.js index 56f1084f58..43157a4a80 100644 --- a/wp-admin/js/inline-edit.js +++ b/wp-admin/js/inline-edit.js @@ -56,6 +56,15 @@ inlineEdit = { t.revert(); } }); + + $('#doaction2').click(function(e){ + if ( $('select[name="action2"]').val() == 'edit' ) { + e.preventDefault(); + t.setBulk(); + } else if ( $('form#posts-filter tr.inline-editor').length > 0 ) { + t.revert(); + } + }); $('#post-query-submit').click(function(e){ if ( $('form#posts-filter tr.inline-editor').length > 0 ) diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index e47307aef9..2c8d0bf8c2 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -244,7 +244,7 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'theme-preview', '/wp-admin/js/theme-preview.js', array( 'thickbox', 'jquery' ), '20080625' ); - $scripts->add( 'inline-edit', '/wp-admin/js/inline-edit.js', array( 'jquery', 'jquery-form', 'suggest' ), '20080925' ); + $scripts->add( 'inline-edit', '/wp-admin/js/inline-edit.js', array( 'jquery', 'jquery-form', 'suggest' ), '20080926' ); $scripts->localize( 'inline-edit', 'inlineEditL10n', array( 'edit' => __('Double-click to edit') ) );