Pro 4.x Feature Request: 'Search Query' Dynamic Content

Hi there!

Related to my other topic around the building of a Search Results Layout, I have implemented this custom hook into the Dynamic Content to add a custom field to return the current search query, allowing me to include the search term in the title of the page. My implementation is very basic, simply using get_search_query() and surrounding it with quote marks if it exists:

case 'search_query':
    $s = get_search_query();
    $result = ( '' != $s ) ? "\"$s\"" : ''; 
    break;

I could see this being expanded to offer access to any query vars present in the url, but just grabbing the search query was the most obvious and useful one that I have come across so far.

I have been able to hook in via the child-theme files, but figured this extension might be valuable to others as well, hence the feature request!

Cheers,

Hey There @arthurodb,

Thank you for this information. I have added your feedback as a feature request.

Cheers.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.