WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#37389 closed defect (bug) (fixed)

Incorrect WP_Error usage in WP_Tax_Query

Reported by: SergeyBiryukov Owned by: SergeyBiryukov
Milestone: 4.6 Priority: normal
Severity: normal Version: 3.2
Component: Taxonomy Keywords:
Focuses: Cc:
PR Number:

Description

In WP_Tax_Query::clean_query() and WP_Tax_Query::transform_query(), strings are used as error codes:

$query = new WP_Error( 'Invalid taxonomy' );
...
$query = new WP_Error( 'Inexistent terms' );

Correct usage would be:

$query = new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.' ) );
...
$query = new WP_Error( 'inexistent_terms', __( 'Inexistent terms.' ) );

Introduced in [17686].

Change History (1)

#1 @SergeyBiryukov
3 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 38079:

Taxonomy: Correct WP_Error usage in WP_Tax_Query::clean_query() and WP_Tax_Query::transform_query().

Fixes #37389.

Note: See TracTickets for help on using tickets.