Skip to content

Commit 9803737

Browse files
committed
Create tsf-advanced-woo-search.php
1 parent 4449405 commit 9803737

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
/**
3+
* Plugin Name: The SEO Framework - Compatibility with Advanced Woo Search
4+
* Plugin URI: https://theseoframework.com/
5+
* Description: This plugin disables TSF's SEO support for Advanced Woo Search pages.
6+
* Version: 1.0.0
7+
* Author: Sybre Waaijer
8+
* Author URI: https://theseoframework.com/
9+
* License: GPLv3
10+
* Requires at least: 5.9
11+
* Requires PHP: 7.4.0
12+
* Requires Plugins: autodescription
13+
*
14+
* @package My_The_SEO_Framework\Compatbility
15+
*/
16+
17+
add_filter(
18+
'the_seo_framework_query_supports_seo',
19+
function ( $supported ) {
20+
// If the query already doesn't support SEO, bail.
21+
if ( ! $supported ) return $supported;
22+
23+
// phpcs:ignore, WordPress.Security.NonceVerification -- We're not processing data.
24+
if ( tsf()->query()->is_search() && ! empty( $_GET['type_aws'] ) )
25+
$supported = false;
26+
27+
return $supported;
28+
},
29+
);

0 commit comments

Comments
 (0)