Changeset 52255
- Timestamp:
- 11/26/2021 11:41:24 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/link-template.php
r52215 r52255 931 931 function get_term_feed_link( $term, $taxonomy = '', $feed = '' ) { 932 932 if ( ! is_object( $term ) ) { 933 $term = (int) $term; 934 $taxonomy = 'category'; 935 } elseif ( ! $term instanceof WP_Term ) { 936 $taxonomy = $term->taxonomy; 933 $term = (int) $term; 937 934 } 938 935 939 936 $term = get_term( $term, $taxonomy ); 937 938 $taxonomy = $term->taxonomy; 940 939 941 940 if ( empty( $term ) || is_wp_error( $term ) ) { -
trunk/tests/phpunit/tests/term/getTermLink.php
r52180 r52255 267 267 268 268 /** 269 * @dataProvider data_get_term_link 270 * 271 * @ticket 50225 272 * 273 * @param string $taxonomy Taxonomy been tested (used for index of term keys). 274 * @param bool $use_id When true, pass term ID. Else, skip the test. 275 */ 276 public function test_get_term_feed_link_backward_compatibility( $taxonomy, $use_id ) { 277 if ( $use_id ) { 278 $term = $this->get_term( $taxonomy, $use_id ); 279 280 $term_feed_link = get_term_feed_link( $term, $taxonomy ); 281 $this->assertIsString( $term_feed_link ); 282 283 $term_feed_link = get_term_feed_link( $term, '' ); 284 $this->assertIsString( $term_feed_link ); 285 } else { 286 $this->markTestSkipped( 'This test requires to pass an id to get_term_feed_link()' ); 287 } 288 } 289 290 /** 269 291 * Data provider. 270 292 *
Note: See TracChangeset
for help on using the changeset viewer.