From 70914a2ca03845f20b010963a1b1ab92bfcd250a Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Sat, 15 Nov 2008 12:04:38 +0000 Subject: [PATCH] QE: fix notices and check if the returned string contains the row HTML, props DD32, fixes #8115 git-svn-id: https://develop.svn.wordpress.org/trunk@9712 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/admin-ajax.php | 6 ++++-- wp-admin/includes/template.php | 3 +++ wp-admin/js/inline-edit-post.js | 24 ++++++++++++++---------- wp-admin/js/inline-edit-tax.js | 6 +----- wp-includes/script-loader.php | 2 +- 5 files changed, 23 insertions(+), 18 deletions(-) diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index 86f28d96c2..a51ecd11fe 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -880,10 +880,12 @@ case 'inline-save': // rename $data['user_ID'] = $GLOBALS['user_ID']; - $data['parent_id'] = $data['post_parent']; + + if ( isset($data['post_parent']) ) + $data['parent_id'] = $data['post_parent']; // status - if ( 'private' == $data['keep_private'] ) + if ( isset($data['keep_private']) && 'private' == $data['keep_private'] ) $data['post_status'] = 'private'; else $data['post_status'] = $data['_status']; diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 2c3ba42c97..4c2fbcef78 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -1170,6 +1170,7 @@ function get_inline_data($post) {
' . mysql2date( 'Y', $post->post_date ) . '
' . mysql2date( 'H', $post->post_date ) . '
' . mysql2date( 'i', $post->post_date ) . '
+
' . mysql2date( 's', $post->post_date ) . '
' . wp_specialchars($post->post_password, 1) . '
'; if( $post->post_type == 'page' ) @@ -2331,6 +2332,8 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) { $minute = ''; printf(_c('%1$s%2$s, %3$s @ %4$s : %5$s|1: month input, 2: day input, 3: year input, 4: hour input, 5: minute input'), $month, $day, $year, $hour, $minute); + echo ''; + if ( $multi ) return; echo "\n\n"; diff --git a/wp-admin/js/inline-edit-post.js b/wp-admin/js/inline-edit-post.js index 4169406aff..dd1a8fd525 100644 --- a/wp-admin/js/inline-edit-post.js +++ b/wp-admin/js/inline-edit-post.js @@ -123,7 +123,7 @@ inlineEditPost = { if ( typeof(id) == 'object' ) id = t.getId(id); - var fields = ['post_title', 'post_name', 'post_author', '_status', 'jj', 'mm', 'aa', 'hh', 'mn', 'post_password']; + var fields = ['post_title', 'post_name', 'post_author', '_status', 'jj', 'mm', 'aa', 'hh', 'mn', 'ss', 'post_password']; if ( t.type == 'page' ) fields.push('post_parent', 'menu_order', 'page_template'); if ( t.type == 'post' ) fields.push('tags_input'); @@ -207,15 +207,19 @@ inlineEditPost = { var row = $(inlineEditPost.what+id); if (r) { - r = r.replace(/hide-if-no-js/, ''); - - - $('#edit-'+id).remove(); - row.html($(r).html()); - if ( 'draft' == $('input[name="post_status"]').val() ) - row.find('td.column-comments').hide(); - inlineEditPost.addEvents(row); - row.fadeIn(); + if ( -1 != r.indexOf(']*?>/g, '' ); + $('#edit-'+id+' .inline-edit-save').append(''+r+''); + } } else { $('#edit-'+id+' .inline-edit-save').append(''+inlineEditL10n.error+''); } diff --git a/wp-admin/js/inline-edit-tax.js b/wp-admin/js/inline-edit-tax.js index b3cff3e68b..9abb060a63 100644 --- a/wp-admin/js/inline-edit-tax.js +++ b/wp-admin/js/inline-edit-tax.js @@ -12,7 +12,6 @@ inlineEditTax = { t.rows = $('tr.iedit'); // prepare the edit row -// .dblclick(function() { inlineEditTax.toggle(this); }) row.keyup(function(e) { if(e.which == 27) return inlineEditTax.revert(); }); $('a.cancel', row).click(function() { return inlineEditTax.revert(); }); @@ -20,7 +19,6 @@ inlineEditTax = { $('input, select', row).keydown(function(e) { if(e.which == 13) return inlineEditTax.save(this); }); // add events -// t.rows.dblclick(function() { inlineEditTax.toggle(this); }); t.addEvents(t.rows); $('#posts-filter input[type="submit"]').click(function(e){ @@ -112,9 +110,7 @@ inlineEditTax = { if ( -1 != r.indexOf('add( 'theme-preview', '/wp-admin/js/theme-preview.js', array( 'thickbox', 'jquery' ), '20080625' ); - $scripts->add( 'inline-edit-post', '/wp-admin/js/inline-edit-post.js', array( 'jquery', 'jquery-form', 'suggest' ), '20081110' ); + $scripts->add( 'inline-edit-post', '/wp-admin/js/inline-edit-post.js', array( 'jquery', 'jquery-form', 'suggest' ), '20081115' ); $scripts->localize( 'inline-edit-post', 'inlineEditL10n', array( 'error' => __('Error while saving the changes.') ) );