Taxonomy: Improve backward compatibility on the `wp-admin/term.php` page.
Specifically, run `do_action( 'edit-tags.php' );` on this new term edit page introduced in [36308]. Changes the GET param back to `tag_ID` and properly sets the screen base in `WP_Screen`. See #34988. Built from https://develop.svn.wordpress.org/trunk@36874 git-svn-id: http://core.svn.wordpress.org/trunk@36841 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5d6513f0bc
commit
033044a872
|
@ -355,6 +355,8 @@ if ( isset($plugin_page) ) {
|
||||||
do_action( 'load-categories.php' );
|
do_action( 'load-categories.php' );
|
||||||
elseif ( $taxnow == 'link_category' )
|
elseif ( $taxnow == 'link_category' )
|
||||||
do_action( 'load-edit-link-categories.php' );
|
do_action( 'load-edit-link-categories.php' );
|
||||||
|
} elseif( 'term.php' === $pagenow ) {
|
||||||
|
do_action( 'edit-tags.php' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -304,6 +304,7 @@ final class WP_Screen {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'edit-tags' :
|
case 'edit-tags' :
|
||||||
|
case 'term' :
|
||||||
if ( null === $post_type && is_object_in_taxonomy( 'post', $taxonomy ? $taxonomy : 'post_tag' ) )
|
if ( null === $post_type && is_object_in_taxonomy( 'post', $taxonomy ? $taxonomy : 'post_tag' ) )
|
||||||
$post_type = 'post';
|
$post_type = 'post';
|
||||||
break;
|
break;
|
||||||
|
@ -322,6 +323,7 @@ final class WP_Screen {
|
||||||
$id .= '-' . $post_type;
|
$id .= '-' . $post_type;
|
||||||
break;
|
break;
|
||||||
case 'edit-tags' :
|
case 'edit-tags' :
|
||||||
|
case 'term' :
|
||||||
if ( null === $taxonomy )
|
if ( null === $taxonomy )
|
||||||
$taxonomy = 'post_tag';
|
$taxonomy = 'post_tag';
|
||||||
// The edit-tags ID does not contain the post type. Look for it in the request.
|
// The edit-tags ID does not contain the post type. Look for it in the request.
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
/** WordPress Administration Bootstrap */
|
/** WordPress Administration Bootstrap */
|
||||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||||
|
|
||||||
if ( empty( $_REQUEST['term_id'] ) ) {
|
if ( empty( $_REQUEST['tag_ID'] ) ) {
|
||||||
$sendback = admin_url( 'edit-tags.php' );
|
$sendback = admin_url( 'edit-tags.php' );
|
||||||
if ( ! empty( $taxnow ) ) {
|
if ( ! empty( $taxnow ) ) {
|
||||||
$sendback = add_query_arg( array( 'taxonomy' => $taxnow ), $sendback );
|
$sendback = add_query_arg( array( 'taxonomy' => $taxnow ), $sendback );
|
||||||
|
@ -19,8 +19,8 @@ if ( empty( $_REQUEST['term_id'] ) ) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$term_id = absint( $_REQUEST['term_id'] );
|
$term_id = absint( $_REQUEST['tag_ID'] );
|
||||||
$tag = get_term( $term_id, $taxnow, OBJECT, 'edit' );
|
$tag = get_term( $term_id, '', OBJECT, 'edit' );
|
||||||
|
|
||||||
if ( ! $tag instanceof WP_Term ) {
|
if ( ! $tag instanceof WP_Term ) {
|
||||||
wp_die( __( 'You attempted to edit an item that doesn’t exist. Perhaps it was deleted?' ) );
|
wp_die( __( 'You attempted to edit an item that doesn’t exist. Perhaps it was deleted?' ) );
|
||||||
|
|
|
@ -573,7 +573,7 @@ function wp_admin_bar_edit_menu( $wp_admin_bar ) {
|
||||||
'href' => get_permalink( $post->ID )
|
'href' => get_permalink( $post->ID )
|
||||||
) );
|
) );
|
||||||
}
|
}
|
||||||
} elseif ( 'edit-tags' == $current_screen->base
|
} elseif ( 'term' == $current_screen->base
|
||||||
&& isset( $tag ) && is_object( $tag ) && ! is_wp_error( $tag )
|
&& isset( $tag ) && is_object( $tag ) && ! is_wp_error( $tag )
|
||||||
&& ( $tax = get_taxonomy( $tag->taxonomy ) )
|
&& ( $tax = get_taxonomy( $tag->taxonomy ) )
|
||||||
&& $tax->public )
|
&& $tax->public )
|
||||||
|
|
|
@ -928,7 +928,7 @@ function get_edit_term_link( $term_id, $taxonomy = '', $object_type = '' ) {
|
||||||
|
|
||||||
$args = array(
|
$args = array(
|
||||||
'taxonomy' => $taxonomy,
|
'taxonomy' => $taxonomy,
|
||||||
'term_id' => $term->term_id,
|
'tag_ID' => $term->term_id,
|
||||||
);
|
);
|
||||||
|
|
||||||
if ( $object_type ) {
|
if ( $object_type ) {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.5-beta2-36873';
|
$wp_version = '4.5-beta2-36874';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue