Migrate Category Edit UI hooks, Standardise on custom-taxonomies hooks, add custom-fields for taxonomies UI hooks. See #11838, Fixes #11191

git-svn-id: http://svn.automattic.com/wordpress/trunk@12941 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
dd32 2010-02-04 10:51:58 +00:00
parent 059e60a37c
commit fc39e39397
2 changed files with 40 additions and 5 deletions

View File

@ -19,7 +19,11 @@ if ( empty($tag_ID) ) { ?>
return;
}
do_action('edit_tag_form_pre', $tag); ?>
if ( 'category' == $taxonomy )
do_action('edit_category_form_pre', $tag );
else
do_action('edit_tag_form_pre', $tag);
do_action('edit_' . $taxonomy . '_form_pre', $tag, $taxonomy); ?>
<div class="wrap">
<?php screen_icon(); ?>
@ -56,9 +60,21 @@ do_action('edit_tag_form_pre', $tag); ?>
<td><textarea name="description" id="description" rows="5" cols="50" style="width: 97%;"><?php echo esc_html($tag->description); ?></textarea><br />
<span class="description"><?php _e('The description is not prominent by default, however some themes may show it.'); ?></span></td>
</tr>
<?php do_action('edit_tag_form_fields', $tag); ?>
<?php
if ( 'category' == $taxonomy )
do_action('edit_category_form_fields', $tag);
else
do_action('edit_tag_form_fields', $tag);
do_action('edit_' . $taxonomy . '_form_fields', $tag, $taxonomy);
?>
</table>
<p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php esc_attr_e('Update Tag'); ?>" /></p>
<?php do_action('edit_tag_form', $tag); ?>
<?php
if ( 'category' == $taxonomy )
do_action('edit_category_form_', $tag);
else
do_action('edit_tag_form_', $tag);
do_action('edit_' . $taxonomy . '_form', $tag, $taxonomy);
?>
</form>
</div>

View File

@ -289,7 +289,12 @@ else
</div>
<?php if ( current_user_can($tax->edit_cap) ) {
do_action('add_tag_form_pre', $taxonomy); ?>
if ( 'category' == $taxonomy )
do_action('add_category_form_pre', (object)array('parent' => 0) );
else
do_action('add_tag_form_pre', $taxonomy);
do_action('add_' . $taxonomy . '_form_pre', $taxonomy);
?>
<div class="form-wrap">
<h3><?php _e('Add a New Tag'); ?></h3>
@ -323,8 +328,22 @@ else
<p><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></p>
</div>
<?php
if ( 'category' == $taxonomy )
do_action('add_category_form_fields');
else
do_action('add_tag_form_fields', $taxonomy);
do_action('add_' . $taxonomy . '_form_fields', $taxonomy);
?>
<p class="submit"><input type="submit" class="button" name="submit" id="submit" value="<?php esc_attr_e('Add Tag'); ?>" /></p>
<?php do_action('add_tag_form', $taxonomy); ?>
<?php
if ( 'category' == $taxonomy )
do_action('edit_category_form', (object)array('parent' => 0) );
else
do_action('add_tag_form', $taxonomy);
do_action('add_' . $taxonomy . '_form', $taxonomy);
?>
</form></div>
<?php } ?>