File tree Expand file tree Collapse file tree 1 file changed +1
-4
lines changed Expand file tree Collapse file tree 1 file changed +1
-4
lines changed Original file line number Diff line number Diff line change @@ -136,13 +136,10 @@ public function get_licenses( WP_REST_Request $data ) {
136136
137137 $ args ['post_title_like ' ] = sanitize_text_field ( $ searched_slug ); // Use the post name (slug) to filter by ID
138138 } elseif ( ! empty ( $ spdx ) ) {
139- // Cast the term to a regex pattern
140- $ regex = $ this ->cast_wildcard_to_regex ( $ spdx );
141-
142139 // If we have no wildcards, look for a direct match
143140 $ args ['meta_query ' ][] = array (
144141 'key ' => 'spdx_identifier_display_text ' ,
145- 'value ' => $ regex ,
142+ 'value ' => str_contains ( $ spdx , ' * ' ) ? $ this -> cast_wildcard_to_regex ( $ spdx ) : sanitize_text_field ( $ spdx ) ,
146143 'compare ' => str_contains ( $ spdx , '* ' ) ? 'REGEXP ' : '== ' ,
147144 );
148145 } elseif ( ! empty ( $ keyword ) ) {
You can’t perform that action at this time.
0 commit comments