| 1 |
<?php |
| 2 |
|
| 3 |
namespace Yoast\WP\SEO\Integrations; |
| 4 |
|
| 5 |
use Yoast\WP\SEO\Conditionals\No_Conditionals; |
| 6 |
|
| 7 |
/** |
| 8 |
* Class to manage the integration with Yoast Duplicate Post. |
| 9 |
*/ |
| 10 |
class Duplicate_Post_Integration implements Integration_Interface { |
| 11 |
|
| 12 |
use No_Conditionals; |
| 13 |
|
| 14 |
/** |
| 15 |
* Initializes the integration. |
| 16 |
* |
| 17 |
* This is the place to register hooks and filters. |
| 18 |
* |
| 19 |
* @return void |
| 20 |
*/ |
| 21 |
public function register_hooks() { |
| 22 |
\add_filter( 'duplicate_post_excludelist_filter', [ $this, 'exclude_zapier_meta' ] ); |
| 23 |
} |
| 24 |
|
| 25 |
/** |
| 26 |
* Filters out the Zapier meta when you copy a post with Yoast Duplicate Post. |
| 27 |
* |
| 28 |
* @param array $meta_excludelist The current excludelist of meta fields. |
| 29 |
* |
| 30 |
* @return array The updated excludelist. |
| 31 |
*/ |
| 32 |
public function exclude_zapier_meta( $meta_excludelist ) { |
| 33 |
$meta_excludelist[] = 'zapier_trigger_sent'; |
| 34 |
return $meta_excludelist; |
| 35 |
} |
| 36 |
} |
| 37 |
|