Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#23919 closed enhancement (duplicate)

Allow Placement of wildcards in meta query like (meta.php WP_Meta_Query)

Reported by: will-b's profile Will B Owned by:
Milestone: Priority: normal
Severity: minor Version: 3.5.1
Component: Query Keywords:
Focuses: Cc:

Description

The LIKE comparison has '%' hardcoded before and after the value (meta.php line 807)

$meta_value = '%' . like_escape( $meta_value ) . '%';

Being able to specify the placement of the wildcards would be helpful
(maybe starts with and end with kinda queries). before and after could be the default.

$meta_value = '%' . like_escape( $meta_value ) . '%'; // default

$meta_value = like_escape( $meta_value ) . '%'; // starts with

$meta_value = '%' . like_escape( $meta_value ); //ends with

Change History (1)

#1 @SergeyBiryukov
12 years ago

  • Component changed from Database to Query
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
  • Type changed from feature request to enhancement

Duplicate of #19738.

Note: See TracTickets for help on using tickets.