Hello!
I think you’re looking for filter the_seo_framework_ld_json_search_url.
If that doesn’t give enough control, try using the_seo_framework_receive_json_data that allows you to overwrite it completely.
Thread Starter
Gio
(@giothelawa)
Sybre, I tried this
add_filter( 'the_seo_framework_ld_json_search_url', function( $url ) {
return home_url( '/აღმოაჩინე-საქართველო/?search_keywords={search_term_string}&sort=latest' );
});
But SST is still added at the end, as shown on the screen https://imgur.com/i2I1nF5. Unfortunately, nothing is searched on how to use the_seo_framework_receive_json_data, please give me a hint…
-
This reply was modified 5 years, 5 months ago by
Gio.
Hi Gio!
It should look a bit like this:
add_filter( 'the_seo_framework_receive_json_data', function( $data, $key ) {
if ( 'website' === $key ) {
if ( isset( $data['potentialAction']['@type'] ) && 'SearchAction' === $data['potentialAction']['@type'] ) {
$data['potentialAction']['target'] = home_url( rawurlencode( 'აღმოაჩინე-საქართველო' ) . '/?search_keywords={search_term_string}&sort=latest' );
$data['potentialAction']['query-input'] = 'required name=search_term_string';
}
}
return $data;
}, 10, 2 );
Thread Starter
Gio
(@giothelawa)
Hi,
You made my day. Thanks a lot, Sybre.