I am new to php and wordpress.
On admin-ajax.php is there a search parameter i can add ?
These parameters are in the ajax post;
action: rblivep
data[uuid]: uid_search_0
data[name]: grid_small_1
data[posts_per_page]: 8
data[pagination]: infinite_scroll
data[crop_size]: foxiz_crop_g1
data[entry_category]: bg-1
data[entry_meta][]: date
data[review]: replace
data[sponsor_meta]: 1
data[entry_format]: bottom
data[excerpt_source]: tagline
data[paged]: 1
data[page_max]: 28
data[processing]: true
data[page_next]: 2
search_query: phones
I added this to the paramters to return only search results but it did not worked.
search_query: phones
No matter what paramter i added i couldn’t get it to give the search results.
2
Answers
I actually find the right answer.
In my case i needed to add this to ajax data.
In WordPress’s admin-ajax.php file, the search parameter is typically not used directly. If you’re trying to modify a custom AJAX request for a specific action ("rblivep" in this case) and want to include a search query, you should append the search query directly to the data array.
Ensure that the "rblivep" action handler on the server side processes the search query parameter appropriately to filter and return the desired search results.