Hide post meta select when meta table is empty, see #8182

git-svn-id: https://develop.svn.wordpress.org/trunk@9992 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2008-12-01 00:29:14 +00:00
parent 54f24f4307
commit cfe7978ca6

View File

@ -923,10 +923,10 @@ function inline_edit_row( $type ) {
$is_page = 'page' == $type; $is_page = 'page' == $type;
if ( $is_page ) { if ( $is_page ) {
$screen = 'edit'; $screen = 'edit-pages';
$post = get_default_page_to_edit(); $post = get_default_page_to_edit();
} else { } else {
$screen = 'edit-pages'; $screen = 'edit';
$post = get_default_post_to_edit(); $post = get_default_post_to_edit();
} }
@ -2300,7 +2300,7 @@ function meta_form() {
if ( $keys ) if ( $keys )
natcasesort($keys); natcasesort($keys);
?> ?>
<p><strong><?php _e( 'Add a new custom field:' ) ?></strong></p> <p><strong><?php _e( 'Add new custom field:' ) ?></strong></p>
<table id="newmeta"> <table id="newmeta">
<thead> <thead>
<tr> <tr>
@ -2312,7 +2312,7 @@ function meta_form() {
<tbody> <tbody>
<tr> <tr>
<td id="newmetaleft" class="left"> <td id="newmetaleft" class="left">
<?php if ( $keys ) : ?> <?php if ( $keys ) { ?>
<select id="metakeyselect" name="metakeyselect" tabindex="7"> <select id="metakeyselect" name="metakeyselect" tabindex="7">
<option value="#NONE#"><?php _e( '- Select -' ); ?></option> <option value="#NONE#"><?php _e( '- Select -' ); ?></option>
<?php <?php
@ -2323,12 +2323,13 @@ function meta_form() {
} }
?> ?>
</select> </select>
<?php endif; ?>
<input class="hide-if-js" type="text" id="metakeyinput" name="metakeyinput" tabindex="7" value="" /> <input class="hide-if-js" type="text" id="metakeyinput" name="metakeyinput" tabindex="7" value="" />
<a href="#postcustomstuff" class="hide-if-no-js" onclick="jQuery('#metakeyinput, #metakeyselect, #enternew, #cancelnew').toggle();return false;"> <a href="#postcustomstuff" class="hide-if-no-js" onclick="jQuery('#metakeyinput, #metakeyselect, #enternew, #cancelnew').toggle();return false;">
<span id="enternew"><?php _e('Enter new'); ?></span> <span id="enternew"><?php _e('Enter new'); ?></span>
<span id="cancelnew" class="hidden"><?php _e('Cancel'); ?></span> <span id="cancelnew" class="hidden"><?php _e('Cancel'); ?></span></a>
</a> <?php } else { ?>
<input type="text" id="metakeyinput" name="metakeyinput" tabindex="7" value="" />
<?php } ?>
</td> </td>
<td><textarea id="metavalue" name="metavalue" rows="2" cols="25" tabindex="8"></textarea></td> <td><textarea id="metavalue" name="metavalue" rows="2" cols="25" tabindex="8"></textarea></td>
</tr> </tr>