Make WordPress Core

Changeset 58807


Ignore:
Timestamp:
07/24/2024 09:40:59 PM (2 years ago)
Author:
flixos90
Message:

Taxonomy: Ensure get_edit_term_link() produces the correct result when called without taxonomy.

This fixes an oversight missed in [36646].

Props debarghyabanerjee.
Fixes #61726.
See #35922.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/link-template.php

    r58212 r58807  
    10931093
    10941094        $args = array(
    1095                 'taxonomy' => $taxonomy,
     1095                'taxonomy' => $tax->name,
    10961096                'tag_ID'   => $term_id,
    10971097        );
  • trunk/tests/phpunit/tests/link/getEditTermLink.php

    r56559 r58807  
    237237                );
    238238        }
     239
     240        /**
     241         * Checks that `get_edit_term_link()` produces the correct URL when called without taxonomy.
     242         *
     243         * @ticket 61726
     244         */
     245        public function test_get_edit_term_link_without_taxonomy() {
     246                $term = $this->get_term( 'wptests_tax', true );
     247
     248                $actual   = get_edit_term_link( $term );
     249                $expected = sprintf( admin_url( 'term.php?taxonomy=wptests_tax&tag_ID=%d&post_type=post' ), $term );
     250                $this->assertSame( $expected, $actual );
     251        }
    239252}
Note: See TracChangeset for help on using the changeset viewer.