Skip to content

Commit 372c2da

Browse files
committed
Address comments
1 parent ad672ec commit 372c2da

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎src/wp-includes/admin-bar.php‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,17 @@ function wp_admin_bar_render() {
118118
/**
119119
* Returns inline SVG markup wrapped for use as an admin bar node icon.
120120
*
121-
* @since 7.1.0
121+
* @since 7.2.0
122122
* @access private
123123
*
124124
* @param string $icon_name Namespaced icon name, e.g. 'core-admin/wordpress'.
125-
* @return string Admin bar icon markup.
125+
* @return string Admin bar icon markup, or empty string if the icon is not found.
126126
*/
127127
function _wp_admin_bar_icon( $icon_name ) {
128128
$svg = wp_get_icon( $icon_name );
129+
if ( '' === $svg ) {
130+
return '';
131+
}
129132
return '<span class="ab-icon svg-icon" aria-hidden="true">' . $svg . '</span>';
130133
}
131134

0 commit comments

Comments
 (0)