Skip to content

Commit aad65ba

Browse files
t-hamanoclaude
andcommitted
Icons: Reject null for the icon collection public property so it cannot silently become non-public.
Co-Authored-By: Claude <noreply@anthropic.com>
1 parent f3d3a93 commit aad65ba

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

‎src/wp-includes/class-wp-icon-collections-registry.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function register( $collection_slug, $collection_properties ) {
123123
return false;
124124
}
125125

126-
if ( isset( $collection_properties['public'] ) && ! is_bool( $collection_properties['public'] ) ) {
126+
if ( array_key_exists( 'public', $collection_properties ) && ! is_bool( $collection_properties['public'] ) ) {
127127
_doing_it_wrong(
128128
__METHOD__,
129129
__( 'Icon collection public property must be a boolean.' ),

‎tests/phpunit/tests/icons/wpIconCollectionsRegistry.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ public function data_non_boolean_public_properties() {
287287
'string' => array( 'false' ),
288288
'integer' => array( 0 ),
289289
'array' => array( array() ),
290+
'null' => array( null ),
290291
);
291292
}
292293
}

0 commit comments

Comments
 (0)