Changeset 11292
- Timestamp:
- 10/22/2021 07:16:10 PM (3 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
r11218 r11292 86 86 * - `slug:example-plugin` will only return THAT plugin, nothing else. 87 87 * - `block:example-plugin/my-block` will return Block directory plugins, or 88 * regular plugins that supply that block if there were no matches in the block directory. 89 * 88 * regular plugins that supply that block if there were no matches in the block directory. 89 * - `block:core/...` will short-circuit out and return an empty array, since no plugin 90 * should provide core blocks. 91 * 90 92 * TODO: This might have been useful as a general search filter for the website too. 91 93 */ 92 if ( !empty( $query['s'] ) ) { 94 if ( ! empty( $query['s'] ) ) { 95 if ( 'block:core/' === substr( $query['s'], 0, 11 ) ) { 96 return $response; 97 } 98 93 99 if ( 'slug:' === substr( $query['s'], 0, 5 ) ) { 94 100 $query['name'] = substr( $query['s'], 5 ); 95 96 unset( $query['s'] );97 101 } 98 102 99 if ( isset( $query['s'] ) &&'block:' === substr( $query['s'], 0, 6 ) ) {103 if ( 'block:' === substr( $query['s'], 0, 6 ) ) { 100 104 $query['meta_query'][] = [ 101 105 'key' => 'block_name', … … 111 115 // Prioritise block plugins, but try again without the restriction. 112 116 $try_again_without_tax_query = true; 113 114 unset( $query['s'], $query['block_search'] );115 117 } 116 118 119 unset( $query['s'], $query['block_search'] ); 117 120 } 118 121
Note: See TracChangeset
for help on using the changeset viewer.