Skip to content

Commit

Permalink
Don't whitelist "WP.+Gutenberg" classes.
Browse files Browse the repository at this point in the history
Let's be more strict to porevent potential issues.
  • Loading branch information
anton-vlasenko committed Jul 20, 2023
1 parent 42ec0e9 commit 27dc135
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/class-wp-duotone-gutenberg.php
Expand Up @@ -32,6 +32,10 @@
* @since 6.3.0
*/

if ( class_exists( 'WP_Duotone_Gutenberg' ) ) {
return;
}

/**
* Manages duotone block supports and global styles.
*
Expand Down
4 changes: 4 additions & 0 deletions lib/class-wp-theme-json-data-gutenberg.php
Expand Up @@ -6,6 +6,10 @@
* @since 6.1.0
*/

if ( class_exists( 'WP_Theme_JSON_Data_Gutenberg' ) ) {
return;
}

/**
* Class to provide access to update a theme.json structure.
*/
Expand Down
4 changes: 4 additions & 0 deletions lib/class-wp-theme-json-gutenberg.php
Expand Up @@ -6,6 +6,10 @@
* @since 5.8.0
*/

if ( class_exists( 'WP_Theme_JSON_Gutenberg' ) ) {
return;
}

/**
* Class that encapsulates the processing of structures that adhere to the theme.json spec.
*
Expand Down
4 changes: 4 additions & 0 deletions lib/class-wp-theme-json-resolver-gutenberg.php
Expand Up @@ -6,6 +6,10 @@
* @since 5.8.0
*/

if ( class_exists( 'WP_Theme_JSON_Resolver_Gutenberg' ) ) {
return;
}

/**
* Class that abstracts the processing of the different data sources
* for site-level config and offers an API to work with them.
Expand Down
1 change: 0 additions & 1 deletion phpcs.xml.dist
Expand Up @@ -122,7 +122,6 @@
</property>
<property name="classesWhiteList" type="array">
<element value="/^Gutenberg.+/"/>
<element value="/^WP_.+_Gutenberg$/"/>
</property>
</properties>
</rule>
Expand Down

0 comments on commit 27dc135

Please sign in to comment.