@@ -44,37 +44,10 @@ public static function instance() {
44
44
* Constructor.
45
45
*/
46
46
public function __construct () {
47
- add_action ( 'the_post ' , [ __CLASS__ , 'strip_editor_modifications ' ] );
48
47
add_filter ( 'wpseo_primary_term_taxonomies ' , [ __CLASS__ , 'disable_yoast_primary_category_picker ' ], 10 , 2 );
49
48
add_action ( 'enqueue_block_editor_assets ' , [ __CLASS__ , 'enqueue_block_editor_assets ' ] );
50
49
}
51
50
52
- /**
53
- * Remove certain editor enqueued assets which might not be compatible with this post type.
54
- */
55
- public static function strip_editor_modifications () {
56
- if ( ! self ::is_editing_sponsor () ) {
57
- return ;
58
- }
59
-
60
- $ enqueue_block_editor_assets_filters = $ GLOBALS ['wp_filter ' ]['enqueue_block_editor_assets ' ]->callbacks ;
61
- $ disallowed_assets = [
62
- 'Newspack_Popups::enqueue_block_editor_assets ' ,
63
- 'Newspack_Newsletters_Editor::enqueue_block_editor_assets ' ,
64
- 'Newspack_Ads_Blocks::enqueue_block_editor_assets ' ,
65
- 'newspack_ads_enqueue_suppress_ad_assets ' ,
66
- ];
67
-
68
- foreach ( $ enqueue_block_editor_assets_filters as $ index => $ filter ) {
69
- $ action_handlers = array_keys ( $ filter );
70
- foreach ( $ action_handlers as $ handler ) {
71
- if ( in_array ( $ handler , $ disallowed_assets ) ) {
72
- remove_action ( 'enqueue_block_editor_assets ' , $ handler , $ index );
73
- }
74
- }
75
- }
76
- }
77
-
78
51
/**
79
52
* Disable the Yoast primary category picker for Sponsor posts and terms.
80
53
*
0 commit comments