<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[26274] trunk/src/wp-admin: Inline documentation for hooks in wp-admin/edit-tags.php.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/26274">26274</a></dd>
<dt>Author</dt> <dd>DrewAPicture</dd>
<dt>Date</dt> <dd>2013-11-19 23:15:07 +0000 (Tue, 19 Nov 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>Inline documentation for hooks in wp-admin/edit-tags.php.
Props pauldewouters for the initial patch.
Fixes <a href="http://core.trac.wordpress.org/ticket/25532">#25532</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminedittagformphp">trunk/src/wp-admin/edit-tag-form.php</a></li>
<li><a href="#trunksrcwpadminedittagsphp">trunk/src/wp-admin/edit-tags.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminedittagformphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/edit-tag-form.php (26273 => 26274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/edit-tag-form.php 2013-11-19 19:34:08 UTC (rev 26273)
+++ trunk/src/wp-admin/edit-tag-form.php 2013-11-19 23:15:07 UTC (rev 26274)
</span><span class="lines">@@ -17,15 +17,19 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Back compat hooks
</span><del>-if ( 'category' == $taxonomy )
- do_action('edit_category_form_pre', $tag );
-elseif ( 'link_category' == $taxonomy )
- do_action('edit_link_category_form_pre', $tag );
-else
- do_action('edit_tag_form_pre', $tag);
</del><ins>+if ( 'category' == $taxonomy ) {
+ /** This action is documented in wp-admin/edit-tags.php */
+ do_action( 'edit_category_form_pre', $tag );
+} elseif ( 'link_category' == $taxonomy ) {
+ /** This action is documented in wp-admin/edit-tags.php */
+ do_action( 'edit_link_category_form_pre', $tag );
+} else {
+ /** This action is documented in wp-admin/edit-tags.php */
+ do_action( 'edit_tag_form_pre', $tag );
+}
+/** This action is documented in wp-admin/edit-tags.php */
+do_action( "{$taxonomy}_pre_edit_form", $tag, $taxonomy ); ?>
</ins><span class="cx">
</span><del>-do_action($taxonomy . '_pre_edit_form', $tag, $taxonomy); ?>
-
</del><span class="cx"> <div class="wrap">
</span><span class="cx"> <?php screen_icon(); ?>
</span><span class="cx"> <h2><?php echo $tax->labels->edit_item; ?></h2>
</span></span></pre></div>
<a id="trunksrcwpadminedittagsphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/edit-tags.php (26273 => 26274)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/edit-tags.php 2013-11-19 19:34:08 UTC (rev 26273)
+++ trunk/src/wp-admin/edit-tags.php 2013-11-19 23:15:07 UTC (rev 26274)
</span><span class="lines">@@ -281,6 +281,13 @@
</span><span class="cx"> 6 => __( 'Tags deleted.' )
</span><span class="cx"> );
</span><span class="cx">
</span><ins>+/**
+ * Filter the messages displayed when a tag is updated.
+ *
+ * @since 3.7.0
+ *
+ * @param array $messages The messages to be displayed.
+ */
</ins><span class="cx"> $messages = apply_filters( 'term_updated_messages', $messages );
</span><span class="cx">
</span><span class="cx"> $message = false;
</span><span class="lines">@@ -340,7 +347,17 @@
</span><span class="cx"> <p><?php printf(__('Tags can be selectively converted to categories using the <a href="%s">tag to category converter</a>.'), 'import.php') ;?></p>
</span><span class="cx"> </div>
</span><span class="cx"> <?php endif;
</span><del>-do_action('after-' . $taxonomy . '-table', $taxonomy);
</del><ins>+
+/**
+ * Fires after the taxonomy list table.
+ *
+ * The dynamic portion of the hook name, $taxonomy, refers to the taxonomy slug.
+ *
+ * @since 3.0.0
+ *
+ * @param string $taxonomy The taxonomy name.
+ */
+do_action( "after-{$taxonomy}-table", $taxonomy );
</ins><span class="cx"> ?>
</span><span class="cx">
</span><span class="cx"> </div>
</span><span class="lines">@@ -368,20 +385,62 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ( current_user_can($tax->cap->edit_terms) ) {
</span><del>- // Back compat hooks. Deprecated in preference to {$taxonomy}_pre_add_form
- if ( 'category' == $taxonomy )
- do_action('add_category_form_pre', (object)array('parent' => 0) );
- elseif ( 'link_category' == $taxonomy )
- do_action('add_link_category_form_pre', (object)array('parent' => 0) );
- else
- do_action('add_tag_form_pre', $taxonomy);
</del><ins>+ if ( 'category' == $taxonomy ) {
+ /**
+ * Fires before the Add Category form.
+ *
+ * @since 2.1.0
+ * @deprecated 3.0.0 Use {$taxonomy}_pre_add_form instead.
+ *
+ * @param object $arg Optional arguments cast to an object.
+ */
+ do_action( 'add_category_form_pre', (object) array( 'parent' => 0 ) );
+ } elseif ( 'link_category' == $taxonomy ) {
+ /**
+ * Fires before the link category form.
+ *
+ * @since 2.3.0
+ * @deprecated 3.0.0 Use {$taxonomy}_pre_add_form instead.
+ *
+ * @param object $arg Optional arguments cast to an object.
+ */
+ do_action( 'add_link_category_form_pre', (object) array( 'parent' => 0 ) );
+ } else {
+ /**
+ * Fires before the Add Tag form.
+ *
+ * @since 2.5.0
+ * @deprecated 3.0.0 Use {$taxonomy}_pre_add_form instead.
+ *
+ * @param string $taxonomy The taxonomy slug.
+ */
+ do_action( 'add_tag_form_pre', $taxonomy );
+ }
</ins><span class="cx">
</span><del>- do_action($taxonomy . '_pre_add_form', $taxonomy);
</del><ins>+ /**
+ * Fires before the Add Term form for all taxonomies.
+ *
+ * The dynamic portion of the hook name, $taxonomy, refers to the taxonomy slug.
+ *
+ * @since 3.0.0
+ *
+ * @param string $taxonomy The taxonomy slug.
+ */
+ do_action( "{$taxonomy}_pre_add_form", $taxonomy );
</ins><span class="cx"> ?>
</span><span class="cx">
</span><span class="cx"> <div class="form-wrap">
</span><span class="cx"> <h3><?php echo $tax->labels->add_new_item; ?></h3>
</span><del>-<form id="addtag" method="post" action="edit-tags.php" class="validate"<?php do_action( $taxonomy . '_term_new_form_tag' ); ?>>
</del><ins>+<?php
+/**
+ * Fires at the beginning of the Add Tag form.
+ *
+ * The dynamic portion of the hook name, $taxonomy, refers to the taxonomy slug.
+ *
+ * @since 3.0.0
+ */
+?>
+<form id="addtag" method="post" action="edit-tags.php" class="validate"<?php do_action( "{$taxonomy}_term_new_form_tag" ); ?>>
</ins><span class="cx"> <input type="hidden" name="action" value="add-tag" />
</span><span class="cx"> <input type="hidden" name="screen" value="<?php echo esc_attr($current_screen->id); ?>" />
</span><span class="cx"> <input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
</span><span class="lines">@@ -414,6 +473,25 @@
</span><span class="cx"> 'show_option_none' => __( 'None' ),
</span><span class="cx"> );
</span><span class="cx">
</span><ins>+ /**
+ * Filter the taxonomy parent drop-down on the Edit Term page.
+ *
+ * @since 3.7.0
+ *
+ * @param array $dropdown_args {
+ * An array of taxonomy parent drop-down arguments.
+ *
+ * @type int|bool $hide_empty Whether to hide terms not attached to any posts. Default 0|false.
+ * @type bool $hide_if_empty Whether to hide the drop-down if no terms exist. Default false.
+ * @type string $taxonomy The taxonomy slug.
+ * @type string $name Value of the name attribute to use for the drop-down select element.
+ * Default 'parent'.
+ * @type string $orderby The field to order by. Default 'name'.
+ * @type bool $hierarchical Whether the taxonomy is hierarchical. Default true.
+ * @type string $show_option_none Label to display if there are no terms. Default 'None'.
+ * }
+ * @param string $taxonomy The taxonomy slug.
+ */
</ins><span class="cx"> $dropdown_args = apply_filters( 'taxonomy_parent_dropdown_args', $dropdown_args, $taxonomy );
</span><span class="cx"> wp_dropdown_categories( $dropdown_args );
</span><span class="cx"> ?>
</span><span class="lines">@@ -429,21 +507,72 @@
</span><span class="cx"> </div>
</span><span class="cx">
</span><span class="cx"> <?php
</span><del>-if ( ! is_taxonomy_hierarchical($taxonomy) )
- do_action('add_tag_form_fields', $taxonomy);
-do_action($taxonomy . '_add_form_fields', $taxonomy);
</del><ins>+if ( ! is_taxonomy_hierarchical( $taxonomy ) ) {
+ /**
+ * Fires after the Add Tag form fields for non-hierarchical taxonomies.
+ *
+ * @since 3.0.0
+ *
+ * @param string $taxonomy The taxonomy slug.
+ */
+ do_action( 'add_tag_form_fields', $taxonomy );
+}
</ins><span class="cx">
</span><ins>+/**
+ * Fires after the Add Term form fields for hierarchical taxonomies.
+ *
+ * The dynamic portion of the hook name, $taxonomy, refers to the taxonomy slug.
+ *
+ * @since 3.0.0
+ *
+ * @param string $taxonomy The taxonomy slug.
+ */
+do_action( "{$taxonomy}_add_form_fields", $taxonomy );
+
</ins><span class="cx"> submit_button( $tax->labels->add_new_item );
</span><span class="cx">
</span><del>-// Back compat hooks. Deprecated in preference to {$taxonomy}_add_form
-if ( 'category' == $taxonomy )
- do_action('edit_category_form', (object)array('parent' => 0) );
-elseif ( 'link_category' == $taxonomy )
- do_action('edit_link_category_form', (object)array('parent' => 0) );
-else
- do_action('add_tag_form', $taxonomy);
</del><ins>+if ( 'category' == $taxonomy ) {
+ /**
+ * Fires at the end of the Edit Category form.
+ *
+ * @since 2.1.0
+ * @deprecated 3.0.0 Use {$taxonomy}_add_form instead.
+ *
+ * @param object $arg Optional arguments cast to an object.
+ */
+ do_action( 'edit_category_form', (object) array( 'parent' => 0 ) );
+} elseif ( 'link_category' == $taxonomy ) {
+ /**
+ * Fires at the end of the Edit Link form.
+ *
+ * @since 2.3.0
+ * @deprecated 3.0.0 Use {$taxonomy}_add_form instead.
+ *
+ * @param object $arg Optional arguments cast to an object.
+ */
+ do_action( 'edit_link_category_form', (object) array( 'parent' => 0 ) );
+} else {
+ /**
+ * Fires at the end of the Add Tag form.
+ *
+ * @since 2.7.0
+ * @deprecated 3.0.0 Use {$taxonomy}_add_form instead.
+ *
+ * @param string $taxonomy The taxonomy slug.
+ */
+ do_action( 'add_tag_form', $taxonomy );
+}
</ins><span class="cx">
</span><del>-do_action($taxonomy . '_add_form', $taxonomy);
</del><ins>+/**
+ * Fires at the end of the Add Term form for all taxonomies.
+ *
+ * The dynamic portion of the hook name, $taxonomy, refers to the taxonomy slug.
+ *
+ * @since 3.0.0
+ *
+ * @param string $taxonomy The taxonomy slug.
+ */
+do_action( "{$taxonomy}_add_form", $taxonomy );
</ins><span class="cx"> ?>
</span><span class="cx"> </form></div>
</span><span class="cx"> <?php } ?>
</span></span></pre>
</div>
</div>
</body>
</html>