mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@36874 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -355,6 +355,8 @@ if ( isset($plugin_page) ) {
|
||||
do_action( 'load-categories.php' );
|
||||
elseif ( $taxnow == 'link_category' )
|
||||
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;
|
||||
case 'edit-tags' :
|
||||
case 'term' :
|
||||
if ( null === $post_type && is_object_in_taxonomy( 'post', $taxonomy ? $taxonomy : 'post_tag' ) )
|
||||
$post_type = 'post';
|
||||
break;
|
||||
@@ -322,6 +323,7 @@ final class WP_Screen {
|
||||
$id .= '-' . $post_type;
|
||||
break;
|
||||
case 'edit-tags' :
|
||||
case 'term' :
|
||||
if ( null === $taxonomy )
|
||||
$taxonomy = 'post_tag';
|
||||
// The edit-tags ID does not contain the post type. Look for it in the request.
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
/** WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( empty( $_REQUEST['term_id'] ) ) {
|
||||
if ( empty( $_REQUEST['tag_ID'] ) ) {
|
||||
$sendback = admin_url( 'edit-tags.php' );
|
||||
if ( ! empty( $taxnow ) ) {
|
||||
$sendback = add_query_arg( array( 'taxonomy' => $taxnow ), $sendback );
|
||||
@@ -19,8 +19,8 @@ if ( empty( $_REQUEST['term_id'] ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$term_id = absint( $_REQUEST['term_id'] );
|
||||
$tag = get_term( $term_id, $taxnow, OBJECT, 'edit' );
|
||||
$term_id = absint( $_REQUEST['tag_ID'] );
|
||||
$tag = get_term( $term_id, '', OBJECT, 'edit' );
|
||||
|
||||
if ( ! $tag instanceof WP_Term ) {
|
||||
wp_die( __( 'You attempted to edit an item that doesn’t exist. Perhaps it was deleted?' ) );
|
||||
|
||||
Reference in New Issue
Block a user