Changeset 9051 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-query-plugins.php
- Timestamp:
- 07/17/2019 07:14:19 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-query-plugins.php
r6287 r9051 60 60 } 61 61 62 // Temporary hacky block search 63 if ( $request->get_param( 'block' ) ) { 64 global $wpdb; 65 $block_search = $request->get_param( 'block' ); 66 $meta_query = array( 67 'relation' => 'OR', 68 array( 69 'key' => 'block_name', 70 'value' => '^' . $block_search, 71 'compare' => 'RLIKE', 72 ), 73 array( 74 'key' => 'block_name', 75 'value' => '/' . $block_search, // search following the slash 76 'compare' => 'RLIKE', 77 ), 78 ); 79 80 // Limit the search to the Block section 81 $query[ 'meta_query' ] = $meta_query; 82 $query[ 'tax_query' ] = array( 83 array( 84 'taxonomy' => 'plugin_section', 85 'field' => 'slug', 86 'terms' => 'block', 87 ) 88 ); 89 } 90 62 91 if ( ! $query ) { 63 92 return $response;
Note: See TracChangeset
for help on using the changeset viewer.