wp-includes/class-wp-icons-registry.php:276Retrieves the content of a registered icon.
$icon_namestringstring|null protected function get_content( $icon_name ) { if ( ! isset( $this->registered_icons[ $icon_name ]['content'] ) ) { $file_path = $this->registered_icons[ $icon_name ]['file_path'] ?? ''; $is_stringy = is_string( $file_path ) || ( is_object( $file_path ) && method_exists( $file_path, '__toString' ) ); $icon_path = $is_stringy ? realpath( (string) $file_path ) : false; if ( ! is_string( $icon_path ) || ! str_ends_with( $icon_path, '.svg' ) || ! is_file( $icon_path ) || ! is_readable( $icon_path ) ) { wp_trigger_error( __METHOD__, __( 'Icon file is missing or unreadable.' ) ); return null; } $content = $this->sanitize_icon_content( file_get_contents( $icon_path ) ); if ( empty( $content ) ) { wp_trigger_error( __METHOD__, __( 'Icon content does not contain valid SVG markup.' ) ); return null; } $this->registered_icons[ $icon_name ]['content'] = $content; } return $this->registered_icons[ $icon_name ]['content']; }Introduced in 7.0.0. Unchanged from 7.0.4 through 7.1.0.
Signature, return type and hooks compared across 2 parsed releases.
src/wp-includes/class-wp-icons-registry.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.