diff --git wp-admin/includes/template.php wp-admin/includes/template.php
index d9790be..f089c45 100644
|
|
|
function wp_comment_trashnotice() { |
| 419 | 419 | * @param unknown_type $meta |
| 420 | 420 | */ |
| 421 | 421 | function list_meta( $meta ) { |
| 422 | | // Exit if no meta |
| 423 | | if ( ! $meta ) { |
| 424 | | echo ' |
| 425 | | <table id="list-table" style="display: none;"> |
| 426 | | <thead> |
| 427 | | <tr> |
| 428 | | <th class="left">' . __( 'Name' ) . '</th> |
| 429 | | <th>' . __( 'Value' ) . '</th> |
| 430 | | </tr> |
| 431 | | </thead> |
| 432 | | <tbody id="the-list" class="list:meta"> |
| 433 | | <tr><td></td></tr> |
| 434 | | </tbody> |
| 435 | | </table>'; //TBODY needed for list-manipulation JS |
| 436 | | return; |
| 437 | | } |
| 438 | 422 | $count = 0; |
| | 423 | $rows = ''; |
| | 424 | |
| | 425 | if ( ! empty( $meta ) ) { |
| | 426 | foreach ( $meta as $entry ) |
| | 427 | $rows .= _list_meta_row( $entry, $count ); |
| | 428 | } |
| 439 | 429 | ?> |
| 440 | | <table id="list-table"> |
| | 430 | <table id="list-table"<?php echo ( $count == 0 ) ? ' style="display:none;"' : ''; ?>> |
| 441 | 431 | <thead> |
| 442 | 432 | <tr> |
| 443 | 433 | <th class="left"><?php _e( 'Name' ) ?></th> |
| … |
… |
function list_meta( $meta ) { |
| 445 | 435 | </tr> |
| 446 | 436 | </thead> |
| 447 | 437 | <tbody id='the-list' class='list:meta'> |
| 448 | | <?php |
| 449 | | foreach ( $meta as $entry ) |
| 450 | | echo _list_meta_row( $entry, $count ); |
| 451 | | ?> |
| | 438 | <?php echo $rows; ?> |
| 452 | 439 | </tbody> |
| 453 | 440 | </table> |
| 454 | 441 | <?php |
| … |
… |
function _list_meta_row( $entry, &$count ) { |
| 467 | 454 | static $update_nonce = false; |
| 468 | 455 | if ( !$update_nonce ) |
| 469 | 456 | $update_nonce = wp_create_nonce( 'add-meta' ); |
| 470 | | |
| 471 | | $r = ''; |
| 472 | | ++ $count; |
| 473 | | if ( $count % 2 ) |
| 474 | | $style = 'alternate'; |
| 475 | | else |
| 476 | | $style = ''; |
| 477 | | if ('_' == $entry['meta_key'] { 0 } ) |
| 478 | | $style .= ' hidden'; |
| 479 | | |
| | 457 | |
| 480 | 458 | if ( is_serialized( $entry['meta_value'] ) ) { |
| 481 | 459 | if ( is_serialized_string( $entry['meta_value'] ) ) { |
| 482 | 460 | // this is a serialized string, so we should display it |
| 483 | 461 | $entry['meta_value'] = maybe_unserialize( $entry['meta_value'] ); |
| 484 | 462 | } else { |
| 485 | | // this is a serialized array/object so we should NOT display it |
| 486 | | --$count; |
| 487 | 463 | return; |
| 488 | 464 | } |
| 489 | 465 | } |
| | 466 | |
| | 467 | $r = ''; |
| | 468 | $style = ''; |
| | 469 | if ('_' == $entry['meta_key'] { 0 } ) { |
| | 470 | $style .= ' hidden'; |
| | 471 | } else { |
| | 472 | ++ $count; // only increase count if the row is visible |
| | 473 | if ( $count % 2 ) |
| | 474 | $style .= ' alternate'; |
| | 475 | } |
| 490 | 476 | |
| 491 | 477 | $entry['meta_key'] = esc_attr($entry['meta_key']); |
| 492 | 478 | $entry['meta_value'] = esc_textarea( $entry['meta_value'] ); // using a <textarea /> |
diff --git wp-admin/js/post.dev.js wp-admin/js/post.dev.js
index 1c39edf..d5e86d0 100644
|
|
|
jQuery(document).ready( function($) { |
| 335 | 335 | s.data += '&post_id=' + $('#post_ID').val(); |
| 336 | 336 | return s; |
| 337 | 337 | } |
| | 338 | }).bind('wpListDelEnd', function(){ |
| | 339 | var tbody = $('#the-list'); |
| | 340 | if (tbody.find('tr:visible').length == 0) { |
| | 341 | tbody.parent().hide(); |
| | 342 | } |
| 338 | 343 | }); |
| 339 | 344 | } |
| 340 | 345 | |