class-compatibility.php
| 1 | <?php |
| 2 | /** |
| 3 | * Admin Compatibility. |
| 4 | * |
| 5 | * @package AdvancedAds |
| 6 | * @author Advanced Ads <info@wpadvancedads.com> |
| 7 | * @since 1.48.2 |
| 8 | */ |
| 9 | |
| 10 | namespace AdvancedAds\Admin; |
| 11 | |
| 12 | use AdvancedAds\Framework\Interfaces\Integration_Interface; |
| 13 | |
| 14 | defined( 'ABSPATH' ) || exit; |
| 15 | |
| 16 | /** |
| 17 | * Admin Compatibility. |
| 18 | */ |
| 19 | class Compatibility implements Integration_Interface { |
| 20 | |
| 21 | /** |
| 22 | * Hook into WordPress. |
| 23 | * |
| 24 | * @return void |
| 25 | */ |
| 26 | public function hooks(): void { |
| 27 | add_action( 'quads_meta_box_post_types', [ $this, 'fix_wpquadspro_issue' ], 11 ); |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * Fixes a WP QUADS PRO compatibility issue |
| 32 | * they inject their ad optimization meta box into our ad page, even though it is not a public post type |
| 33 | * using they filter, we remove AA from the list of post types they inject this box into |
| 34 | * |
| 35 | * @param array $allowed_post_types Array of allowed post types. |
| 36 | * |
| 37 | * @return array |
| 38 | */ |
| 39 | public function fix_wpquadspro_issue( $allowed_post_types ): array { |
| 40 | unset( $allowed_post_types['advanced_ads'] ); |
| 41 | |
| 42 | return $allowed_post_types; |
| 43 | } |
| 44 | } |
| 45 |