Pilot-in / PiloPress

The most advanced WordPress Page Builder using Advanced Custom Fields & TailwindCSS
https://www.pilopress.com
62 stars 11 forks source link

Title shortcode - Use "search title" when in a `is_search()` condition #228

Open DamChtlv opened 1 year ago

DamChtlv commented 1 year ago

In this code:
https://github.com/Pilot-in/PiloPress/blob/ff1e79e67cf9abd6ce5e1fce4b087d8a094f44da/includes/classes/admin/editor/class-shortcodes.php#L184-L187

Should take example of the wp_get_document_title() function code for this shortcode:

Have something like:

if ( is_search() ) {
    $title = sprintf( __( 'Search Results for “%s”' ), get_search_query() );