X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/849f15aeed7a5e39314057bdc0064d8edd60dd7d..5e031ad59895b5682d1509675cafe9f2c5081c12:/wp-admin/edit-tags.php diff --git a/wp-admin/edit-tags.php b/wp-admin/edit-tags.php index e0cd746e..7afbec8b 100644 --- a/wp-admin/edit-tags.php +++ b/wp-admin/edit-tags.php @@ -20,6 +20,9 @@ if ( ! $tax ) if ( ! current_user_can( $tax->cap->manage_terms ) ) wp_die( __( 'Cheatin’ uh?' ), 403 ); +// $post_type is set when the WP_Terms_List_Table instance is created +global $post_type; + $wp_list_table = _get_list_table('WP_Terms_List_Table'); $pagenum = $wp_list_table->get_pagenum(); @@ -28,7 +31,7 @@ $title = $tax->labels->name; if ( 'post' != $post_type ) { $parent_file = ( 'attachment' == $post_type ) ? 'upload.php' : "edit.php?post_type=$post_type"; $submenu_file = "edit-tags.php?taxonomy=$taxonomy&post_type=$post_type"; -} else if ( 'link_category' == $tax->name ) { +} elseif ( 'link_category' == $tax->name ) { $parent_file = 'link-manager.php'; $submenu_file = 'edit-tags.php?taxonomy=link_category'; } else { @@ -36,7 +39,7 @@ if ( 'post' != $post_type ) { $submenu_file = "edit-tags.php?taxonomy=$taxonomy"; } -add_screen_option( 'per_page', array( 'label' => $title, 'default' => 20, 'option' => 'edit_' . $tax->name . '_per_page' ) ); +add_screen_option( 'per_page', array( 'default' => 20, 'option' => 'edit_' . $tax->name . '_per_page' ) ); $location = false; @@ -62,7 +65,7 @@ case 'add-tag': if ( $ret && !is_wp_error( $ret ) ) $location = add_query_arg( 'message', 1, $location ); else - $location = add_query_arg( 'message', 4, $location ); + $location = add_query_arg( array( 'error' => true, 'message' => 4 ), $location ); break; @@ -153,7 +156,7 @@ case 'editedtag': if ( $ret && !is_wp_error( $ret ) ) $location = add_query_arg( 'message', 3, $location ); else - $location = add_query_arg( 'message', 5, $location ); + $location = add_query_arg( array( 'error' => true, 'message' => 5 ), $location ); break; } @@ -230,11 +233,11 @@ if ( 'category' == $taxonomy || 'link_category' == $taxonomy || 'post_tag' == $t $help = '

' . __( 'For more information:' ) . '

'; if ( 'category' == $taxonomy ) - $help .= '

' . __( 'Documentation on Categories' ) . '

'; + $help .= '

' . __( 'Documentation on Categories' ) . '

'; elseif ( 'link_category' == $taxonomy ) - $help .= '

' . __( 'Documentation on Link Categories' ) . '

'; + $help .= '

' . __( 'Documentation on Link Categories' ) . '

'; else - $help .= '

' . __( 'Documentation on Tags' ) . '

'; + $help .= '

' . __( 'Documentation on Tags' ) . '

'; $help .= '

' . __('Support Forums') . '

'; @@ -294,6 +297,7 @@ if ( isset( $_REQUEST['message'] ) && ( $msg = (int) $_REQUEST['message'] ) ) { $message = $messages['_item'][ $msg ]; } +$class = ( isset( $_REQUEST['error'] ) ) ? 'error' : 'updated'; ?>
@@ -303,12 +307,12 @@ if ( !empty($_REQUEST['s']) ) -

- notice is-dismissible">

+
-
+ @@ -321,7 +325,7 @@ endif; ?>
- + @@ -478,6 +482,7 @@ do_action( "{$taxonomy}_term_new_form_tag" ); * Filter the taxonomy parent drop-down on the Edit Term page. * * @since 3.7.0 + * @since 4.2.0 Added `$context` parameter. * * @param array $dropdown_args { * An array of taxonomy parent drop-down arguments. @@ -492,8 +497,10 @@ do_action( "{$taxonomy}_term_new_form_tag" ); * @type string $show_option_none Label to display if there are no terms. Default 'None'. * } * @param string $taxonomy The taxonomy slug. + * @param string $context Filter context. Accepts 'new' or 'edit'. */ - $dropdown_args = apply_filters( 'taxonomy_parent_dropdown_args', $dropdown_args, $taxonomy ); + $dropdown_args = apply_filters( 'taxonomy_parent_dropdown_args', $dropdown_args, $taxonomy, 'new' ); + wp_dropdown_categories( $dropdown_args ); ?> @@ -520,7 +527,7 @@ if ( ! is_taxonomy_hierarchical( $taxonomy ) ) { } /** - * Fires after the Add Term form fields for hierarchical taxonomies. + * Fires after the Add Term form fields. * * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug. *