Ah, okay. In which case, this little guide’ll help you:
https://wpengineer.com/2258/change-the-search-url-of-wordpress/
It lets you know how to redirect when wordpress is usually going to it’s default search page. From the guide with a couple of changes for best practice:
add_action( 'template_redirect', function() {
if ( is_search() && ! empty( $_GET['s'] ) ) {
wp_redirect( home_url( "/search/" ) . urlencode( get_query_var( 's' ) ) );
wp_die();
}
} );
The trouble here is that it redirects all searches (thus in your situation preventing you from ever searching wordpress). Hence you may well wish to use:
add_action( 'bop_nav_search_hidden_inputs', function( $item, $depth, $args ){
?>
<input type="hidden" name="search-type" value="advanced-search">
<?php
}, 10, 3 );
in order to identify this search form from others. And then you’d use:
add_action( 'template_redirect', function() {
if ( is_search() && ! empty( $_GET['s'] ) && isset( $_GET['search-type'] ) && $_GET['search-type'] == 'advanced-search' ) {
$page_url = home_url( "/advanced-search/" );
wp_redirect( $page_url . '?q=' . urlencode( get_query_var( 's' ) ) );
wp_die();
}
} );
which is adjusted to your use-case. Finally, in your advanced-search page template, add the following to the top:
$search_query = isset( $_GET['q'] ) ? wp_strip_all_tags( $_GET['q'] ) : '';
Then $search_query
has the value to put in the iframe url.
Note the importance of wp_strip_all_tags
; it prevents XSS attacks.
Cheers,
Joe
P.S. Just to note that these things are, by and large, outside the remit of this plugin (because it is largely about what is happening after a search is made rather than about where the search form is put in the page), which is why they are not included as options or anything like that.