2008-01-25 19:29:01 +00:00
< ? php
2008-08-16 07:27:34 +00:00
/**
* Edit tag form for inclusion in administration panels .
*
* @ package WordPress
* @ subpackage Administration
*/
2009-08-03 00:04:45 +00:00
// don't load directly
if ( ! defined ( 'ABSPATH' ) )
die ( '-1' );
2008-10-25 08:01:37 +00:00
if ( empty ( $tag_ID ) ) { ?>
2010-04-11 10:41:54 +00:00
< div id = " message " class = " updated " >< p >< strong >< ? php _e ( 'You did not select an item for editing.' ); ?> </strong></p></div>
2008-10-25 08:01:37 +00:00
< ? php
return ;
2008-01-25 19:29:01 +00:00
}
2008-10-25 08:01:37 +00:00
2010-02-04 10:51:58 +00:00
if ( 'category' == $taxonomy )
do_action ( 'edit_category_form_pre' , $tag );
else
do_action ( 'edit_tag_form_pre' , $tag );
2010-02-09 10:56:39 +00:00
do_action ( $taxonomy . '_pre_edit_form' , $tag , $taxonomy ); ?>
2008-01-25 19:29:01 +00:00
< div class = " wrap " >
2008-11-26 23:35:23 +00:00
< ? php screen_icon (); ?>
2010-05-14 00:34:04 +00:00
< h2 >< ? php echo $tax -> labels -> edit_item ; ?> </h2>
2008-01-25 19:29:01 +00:00
< div id = " ajax-response " ></ div >
2008-10-25 08:01:37 +00:00
< form name = " edittag " id = " edittag " method = " post " action = " edit-tags.php " class = " validate " >
< input type = " hidden " name = " action " value = " editedtag " />
2009-05-05 19:43:53 +00:00
< input type = " hidden " name = " tag_ID " value = " <?php echo esc_attr( $tag->term_id ) ?> " />
< input type = " hidden " name = " taxonomy " value = " <?php echo esc_attr( $taxonomy ) ?> " />
2008-10-25 08:01:37 +00:00
< ? php wp_original_referer_field ( true , 'previous' ); wp_nonce_field ( 'update-tag_' . $tag_ID ); ?>
2008-02-24 04:33:10 +00:00
< table class = " form-table " >
2008-01-25 19:29:01 +00:00
< tr class = " form-field form-required " >
2010-05-14 21:46:25 +00:00
< th scope = " row " valign = " top " >< label for = " name " >< ? php _ex ( 'Name' , 'Taxonomy Name' ); ?> </label></th>
2010-02-13 03:08:16 +00:00
< td >< input name = " name " id = " name " type = " text " value = " <?php if ( isset( $tag->name ) ) echo esc_attr( $tag->name ); ?> " size = " 40 " aria - required = " true " />
< p class = " description " >< ? php _e ( 'The name is how it appears on your site.' ); ?> </p></td>
2008-01-25 19:29:01 +00:00
</ tr >
2010-03-16 17:17:55 +00:00
< ? php if ( ! global_terms_enabled () ) { ?>
2008-01-25 19:29:01 +00:00
< tr class = " form-field " >
2010-05-14 21:46:25 +00:00
< th scope = " row " valign = " top " >< label for = " slug " >< ? php _ex ( 'Slug' , 'Taxonomy Slug' ); ?> </label></th>
2009-05-05 19:43:53 +00:00
< td >< input name = " slug " id = " slug " type = " text " value = " <?php if ( isset( $tag->slug ) ) echo esc_attr(apply_filters('editable_slug', $tag->slug )); ?> " size = " 40 " />
2010-01-24 11:00:27 +00:00
< p class = " description " >< ? php _e ( 'The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ); ?> </p></td>
</ tr >
< ? php } ?>
2010-02-13 03:08:16 +00:00
< ? php if ( is_taxonomy_hierarchical ( $taxonomy ) ) : ?>
2010-01-24 11:00:27 +00:00
< tr class = " form-field " >
2010-05-14 21:46:25 +00:00
< th scope = " row " valign = " top " >< label for = " parent " >< ? php _ex ( 'Parent' , 'Taxonomy Parent' ); ?> </label></th>
2010-01-24 11:00:27 +00:00
< td >
< ? php wp_dropdown_categories ( array ( 'hide_empty' => 0 , 'hide_if_empty' => false , 'name' => 'parent' , 'orderby' => 'name' , 'taxonomy' => $taxonomy , 'selected' => $tag -> parent , 'exclude' => $tag -> term_id , 'hierarchical' => true , 'show_option_none' => __ ( 'None' ))); ?> <br />
2010-02-13 03:08:16 +00:00
< ? php if ( 'category' == $taxonomy ) : ?>
2010-01-24 11:00:27 +00:00
< span class = " description " >< ? php _e ( 'Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.' ); ?> </span>
2010-02-13 03:08:16 +00:00
< ? php endif ; ?>
2010-01-24 11:00:27 +00:00
</ td >
2008-01-25 19:29:01 +00:00
</ tr >
2010-02-13 03:08:16 +00:00
< ? php endif ; // is_taxonomy_hierarchical() ?>
2009-04-09 16:00:40 +00:00
< tr class = " form-field " >
2010-05-14 21:46:25 +00:00
< th scope = " row " valign = " top " >< label for = " description " >< ? php _ex ( 'Description' , 'Taxonomy Description' ); ?> </label></th>
2009-05-18 15:11:07 +00:00
< td >< textarea name = " description " id = " description " rows = " 5 " cols = " 50 " style = " width: 97%; " >< ? php echo esc_html ( $tag -> description ); ?> </textarea><br />
2010-01-24 11:00:27 +00:00
< span class = " description " >< ? php _e ( 'The description is not prominent by default, however some themes may show it.' ); ?> </span></td>
2009-04-09 16:00:40 +00:00
</ tr >
2010-02-04 10:51:58 +00:00
< ? php
2010-02-08 18:02:23 +00:00
if ( 'category' == $taxonomy )
2010-02-04 10:51:58 +00:00
do_action ( 'edit_category_form_fields' , $tag );
else
do_action ( 'edit_tag_form_fields' , $tag );
2010-02-09 10:56:39 +00:00
do_action ( $taxonomy . '_edit_form_fields' , $tag , $taxonomy );
2010-02-04 10:51:58 +00:00
?>
2008-01-25 19:29:01 +00:00
</ table >
2010-02-08 18:02:23 +00:00
< ? php
if ( 'category' == $taxonomy )
2010-02-09 10:56:39 +00:00
do_action ( 'edit_category_form' , $tag );
2010-02-04 10:51:58 +00:00
else
2010-02-09 10:56:39 +00:00
do_action ( 'edit_tag_form' , $tag );
do_action ( $taxonomy . '_edit_form' , $tag , $taxonomy );
2010-02-04 10:51:58 +00:00
?>
2010-05-14 00:34:04 +00:00
< p class = " submit " >< input type = " submit " class = " button-primary " name = " submit " value = " <?php echo esc_attr( __( 'Update' ) ); ?> " /></ p >
2008-01-25 19:29:01 +00:00
</ form >
</ div >