You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$this->assertFalse( has_filter( 'content_save_pre', 'wp_strip_custom_css_from_blocks' ), 'content_save_pre filter should not be added for users with edit_css.' );
167
170
$this->assertFalse( has_filter( 'content_filtered_save_pre', 'wp_strip_custom_css_from_blocks' ), 'content_filtered_save_pre filter should not be added for users with edit_css.' );
168
171
172
+
if ( is_multisite() ) {
173
+
revoke_super_admin( $admin_id );
174
+
}
169
175
wp_set_current_user( 0 );
176
+
wp_custom_css_remove_filters();
170
177
}
171
178
172
179
/**
@@ -182,14 +189,23 @@ public function test_filter_not_added_for_user_with_edit_css() {
// Switching to a user without edit_css should add the filter via the set_current_user action.
186
197
wp_set_current_user( $author_id );
187
198
$this->assertNotFalse( has_filter( 'content_save_pre', 'wp_strip_custom_css_from_blocks' ), 'Filter should be active for user without edit_css.' );
188
199
200
+
// Switching to a user with edit_css should remove the filter via the set_current_user action.
189
201
wp_set_current_user( $admin_id );
190
202
$this->assertFalse( has_filter( 'content_save_pre', 'wp_strip_custom_css_from_blocks' ), 'Filter should be removed after switching to a user with edit_css.' );
191
203
204
+
if ( is_multisite() ) {
205
+
revoke_super_admin( $admin_id );
206
+
}
192
207
wp_set_current_user( 0 );
208
+
wp_custom_css_remove_filters();
193
209
}
194
210
195
211
/**
@@ -201,6 +217,9 @@ public function test_set_current_user_action_triggers_reinit() {
@@ -210,6 +229,9 @@ public function test_force_filtered_html_on_import_enables_filter_for_privileged
210
229
211
230
$this->assertNotFalse( has_filter( 'content_save_pre', 'wp_strip_custom_css_from_blocks' ), 'Filter should be enabled during import regardless of user capability.' );
0 commit comments