diff --git src/wp-admin/admin.php src/wp-admin/admin.php
index 46977f9..03426c1 100644
|
|
|
if ( isset($plugin_page) ) { |
| 355 | 355 | do_action( 'load-categories.php' ); |
| 356 | 356 | elseif ( $taxnow == 'link_category' ) |
| 357 | 357 | do_action( 'load-edit-link-categories.php' ); |
| | 358 | } elseif( 'term.php' === $pagenow ) { |
| | 359 | do_action( 'edit-tags.php' ); |
| 358 | 360 | } |
| 359 | 361 | } |
| 360 | 362 | |
diff --git src/wp-admin/includes/class-wp-screen.php src/wp-admin/includes/class-wp-screen.php
index 5a02928..ebd20b8 100644
|
|
|
final class WP_Screen { |
| 304 | 304 | } |
| 305 | 305 | break; |
| 306 | 306 | case 'edit-tags' : |
| | 307 | case 'term' : |
| 307 | 308 | if ( null === $post_type && is_object_in_taxonomy( 'post', $taxonomy ? $taxonomy : 'post_tag' ) ) |
| 308 | 309 | $post_type = 'post'; |
| 309 | 310 | break; |
| … |
… |
final class WP_Screen { |
| 322 | 323 | $id .= '-' . $post_type; |
| 323 | 324 | break; |
| 324 | 325 | case 'edit-tags' : |
| | 326 | case 'term' : |
| 325 | 327 | if ( null === $taxonomy ) |
| 326 | 328 | $taxonomy = 'post_tag'; |
| 327 | 329 | // The edit-tags ID does not contain the post type. Look for it in the request. |
diff --git src/wp-admin/term.php src/wp-admin/term.php
index 6d00f50..5454874 100644
|
|
|
|
| 10 | 10 | /** WordPress Administration Bootstrap */ |
| 11 | 11 | require_once( dirname( __FILE__ ) . '/admin.php' ); |
| 12 | 12 | |
| 13 | | if ( empty( $_REQUEST['term_id'] ) ) { |
| | 13 | if ( empty( $_REQUEST['tag_ID'] ) ) { |
| 14 | 14 | $sendback = admin_url( 'edit-tags.php' ); |
| 15 | 15 | if ( ! empty( $taxnow ) ) { |
| 16 | 16 | $sendback = add_query_arg( array( 'taxonomy' => $taxnow ), $sendback ); |
| … |
… |
if ( empty( $_REQUEST['term_id'] ) ) { |
| 19 | 19 | exit; |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | | $term_id = absint( $_REQUEST['term_id'] ); |
| 23 | | $tag = get_term( $term_id, $taxnow, OBJECT, 'edit' ); |
| | 22 | $term_id = absint( $_REQUEST['tag_ID'] ); |
| | 23 | $tag = get_term( $term_id, '', OBJECT, 'edit' ); |
| 24 | 24 | |
| 25 | 25 | if ( ! $tag instanceof WP_Term ) { |
| 26 | 26 | wp_die( __( 'You attempted to edit an item that doesn’t exist. Perhaps it was deleted?' ) ); |
diff --git src/wp-includes/admin-bar.php src/wp-includes/admin-bar.php
index 5bb2fcd..ab6d055 100644
|
|
|
function wp_admin_bar_edit_menu( $wp_admin_bar ) { |
| 573 | 573 | 'href' => get_permalink( $post->ID ) |
| 574 | 574 | ) ); |
| 575 | 575 | } |
| 576 | | } elseif ( 'edit-tags' == $current_screen->base |
| | 576 | } elseif ( 'term' == $current_screen->base |
| 577 | 577 | && isset( $tag ) && is_object( $tag ) && ! is_wp_error( $tag ) |
| 578 | 578 | && ( $tax = get_taxonomy( $tag->taxonomy ) ) |
| 579 | 579 | && $tax->public ) |
diff --git src/wp-includes/link-template.php src/wp-includes/link-template.php
index 8064814..a7ad29d 100644
|
|
|
function get_edit_term_link( $term_id, $taxonomy = '', $object_type = '' ) { |
| 928 | 928 | |
| 929 | 929 | $args = array( |
| 930 | 930 | 'taxonomy' => $taxonomy, |
| 931 | | 'term_id' => $term->term_id, |
| | 931 | 'tag_ID' => $term->term_id, |
| 932 | 932 | ); |
| 933 | 933 | |
| 934 | 934 | if ( $object_type ) { |
diff --git tests/phpunit/tests/post.php tests/phpunit/tests/post.php
index 4f5a294..a1ec373 100644
|
|
|
class Tests_Post extends WP_UnitTestCase { |
| 991 | 991 | $term = reset( $terms ); |
| 992 | 992 | |
| 993 | 993 | foreach ( $matches[1] as $url ) { |
| 994 | | $this->assertContains( 'term_id=' . $term->term_id, $url ); |
| | 994 | $this->assertContains( 'tag_ID=' . $term->term_id, $url ); |
| 995 | 995 | $this->assertContains( 'post_type=new_post_type', $url ); |
| 996 | 996 | } |
| 997 | 997 | } |
diff --git tests/phpunit/tests/term/getEditTermLink.php tests/phpunit/tests/term/getEditTermLink.php
index 5402327..c0844b9 100644
|
|
|
class Tests_Term_GetEditTermLink extends WP_UnitTestCase { |
| 17 | 17 | ) ); |
| 18 | 18 | |
| 19 | 19 | $actual = get_edit_term_link( $term1, 'wptests_tax' ); |
| 20 | | $expected = 'http://' . WP_TESTS_DOMAIN . '/wp-admin/term.php?taxonomy=wptests_tax&term_id=' . $term1 . '&post_type=post'; |
| | 20 | $expected = 'http://' . WP_TESTS_DOMAIN . '/wp-admin/term.php?taxonomy=wptests_tax&tag_ID=' . $term1 . '&post_type=post'; |
| 21 | 21 | $this->assertEquals( $expected, $actual ); |
| 22 | 22 | } |
| 23 | 23 | |