Make WordPress Core

Changeset 36874


Ignore:
Timestamp:
03/07/2016 12:55:04 PM (9 years ago)
Author:
swissspidy
Message:

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.

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/admin.php

    r36709 r36874  
    356356        elseif ( $taxnow == 'link_category' )
    357357            do_action( 'load-edit-link-categories.php' );
     358    } elseif( 'term.php' === $pagenow ) {
     359        do_action( 'edit-tags.php' );
    358360    }
    359361}
  • trunk/src/wp-admin/includes/class-wp-screen.php

    r36137 r36874  
    305305                    break;
    306306                case 'edit-tags' :
     307                case 'term' :
    307308                    if ( null === $post_type && is_object_in_taxonomy( 'post', $taxonomy ? $taxonomy : 'post_tag' ) )
    308309                        $post_type = 'post';
     
    323324                break;
    324325            case 'edit-tags' :
     326            case 'term' :
    325327                if ( null === $taxonomy )
    326328                    $taxonomy = 'post_tag';
  • trunk/src/wp-admin/term.php

    r36497 r36874  
    1111require_once( dirname( __FILE__ ) . '/admin.php' );
    1212
    13 if ( empty( $_REQUEST['term_id'] ) ) {
     13if ( empty( $_REQUEST['tag_ID'] ) ) {
    1414    $sendback = admin_url( 'edit-tags.php' );
    1515    if ( ! empty( $taxnow ) ) {
     
    2020}
    2121
    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' );
    2424
    2525if ( ! $tag instanceof WP_Term ) {
  • trunk/src/wp-includes/admin-bar.php

    r36601 r36874  
    574574                ) );
    575575            }
    576         } elseif ( 'edit-tags' == $current_screen->base
     576        } elseif ( 'term' == $current_screen->base
    577577            && isset( $tag ) && is_object( $tag ) && ! is_wp_error( $tag )
    578578            && ( $tax = get_taxonomy( $tag->taxonomy ) )
  • trunk/src/wp-includes/link-template.php

    r36709 r36874  
    929929    $args = array(
    930930        'taxonomy' => $taxonomy,
    931         'term_id'  => $term->term_id,
     931        'tag_ID'   => $term->term_id,
    932932    );
    933933
  • trunk/tests/phpunit/tests/post.php

    r36309 r36874  
    992992
    993993        foreach ( $matches[1] as $url ) {
    994             $this->assertContains( 'term_id=' . $term->term_id, $url );
     994            $this->assertContains( 'tag_ID=' . $term->term_id, $url );
    995995            $this->assertContains( 'post_type=new_post_type', $url );
    996996        }
  • trunk/tests/phpunit/tests/term/getEditTermLink.php

    r36646 r36874  
    1818
    1919        $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';
    2121        $this->assertEquals( $expected, $actual );
    2222    }
Note: See TracChangeset for help on using the changeset viewer.