| @@ -18,8 +18,17 @@ | ||
| 18 | 18 | if ( empty( $attributes['icon'] ) ) { |
| 19 | 19 | return; |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | + // Icons in non-public collections are not available in the editor, so do not render them either. | |
| 23 | + $registered_icon = WP_Icons_Registry::get_instance()->get_registered_icon( $attributes['icon'] ); | |
| 24 | + if ( null !== $registered_icon ) { | |
| 25 | + $icon_collection = WP_Icon_Collections_Registry::get_instance()->get_registered( $registered_icon['collection'] ); | |
| 26 | + if ( null !== $icon_collection && ! $icon_collection['public'] ) { | |
| 27 | + return; | |
| 28 | + } | |
| 29 | + } | |
| 30 | + | |
| 22 | 31 | // Text color and background color. |
| 23 | 32 | $color_styles = array(); |
| 24 | 33 | |
| 25 | 34 | $preset_text_color = array_key_exists( 'textColor', $attributes ) ? "var:preset|color|{$attributes['textColor']}" : null; |