Ticket #28326: 28326.diff
File 28326.diff, 2.7 KB (added by , 9 years ago) |
---|
-
src/wp-admin/edit.php
303 303 304 304 <input type="hidden" name="post_status" class="post_status_page" value="<?php echo !empty($_REQUEST['post_status']) ? esc_attr($_REQUEST['post_status']) : 'all'; ?>" /> 305 305 <input type="hidden" name="post_type" class="post_type_page" value="<?php echo $post_type; ?>" /> 306 < ?php if ( ! empty( $_REQUEST['show_sticky'] ) ) { ?>307 <input type="hidden" name="show_sticky" value="1" /> 308 <?php } ?>306 <input type="hidden" name="show_sticky" class="show_sticky_page" value="<?php 307 echo ! empty( $_REQUEST['show_sticky'] ) && 1 === (int) $_REQUEST['show_sticky'] ? 1 : 0; 308 ?>" /> 309 309 310 310 <?php $wp_list_table->display(); ?> 311 311 -
src/wp-admin/includes/ajax-actions.php
1530 1530 // update the post 1531 1531 edit_post(); 1532 1532 1533 if ( ! empty( $data['sticky_page'] ) && empty( $data['sticky'] ) ) { 1534 wp_send_json( array( 'action' => 'remove-sticky' ) ); 1535 } 1536 1533 1537 $wp_list_table = _get_list_table( 'WP_Posts_List_Table', array( 'screen' => $_POST['screen'] ) ); 1534 1538 1535 1539 $level = 0; -
src/wp-admin/js/inline-edit-post.js
239 239 }, 240 240 241 241 save : function(id) { 242 var params, fields, page = $('.post_status_page').val() || ''; 242 var params, fields, 243 page = $('.post_status_page').val() || '', 244 sticky = $('.show_sticky_page').val() || ''; 243 245 244 246 if ( typeof(id) === 'object' ) { 245 247 id = this.getId(id); … … 252 254 post_type: typenow, 253 255 post_ID: id, 254 256 edit_date: 'true', 255 post_status: page 257 post_status: page, 258 sticky_page: sticky 256 259 }; 257 260 258 261 fields = $('#edit-'+id).find(':input').serialize(); … … 261 264 // make ajax request 262 265 $.post( ajaxurl, params, 263 266 function(r) { 267 var el, count; 264 268 $('table.widefat .spinner').hide(); 265 269 266 270 if (r) { 271 if ( 0 === r.indexOf('{') ) { 272 r = $.parseJSON(r); 273 switch (r.action) { 274 case 'remove-sticky': 275 $(inlineEditPost.what+id).remove(); 276 $('#edit-'+id).remove(); 277 278 el = $('.subsubsub .sticky .count'); 279 count = parseInt(el.text().replace(/\(|\)/, ''), 10) - 1; 280 el.text( '(' + count + ')' ); 281 break; 282 } 283 284 return false; 285 } 286 267 287 if ( -1 !== r.indexOf( '<tr' ) ) { 268 288 $(inlineEditPost.what+id).remove(); 269 289 $('#edit-'+id).before(r).remove();