HEX
Server: Apache/2
System: Linux saturn 4.18.0-477.15.1.lve.2.el8.x86_64 #1 SMP Wed Aug 2 10:43:45 UTC 2023 x86_64
User: centuryt (1072)
PHP: 7.4.33
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/centuryt/public_html/wp-content/themes/woostify/inc/class-woostify-icon.php
<?php
/**
 * Woostify Icon Class
 *
 * @package  woostify
 */

defined( 'ABSPATH' ) || exit;

if ( ! class_exists( 'Woostify_Icon' ) ) {
	/**
	 * Class Woostify_Icon
	 */
	class Woostify_Icon {
		/**
		 * Woostify SVGs.
		 *
		 * @var woostify_svgs
		 */
		private static $woostify_svgs = null;

		/**
		 * Woostify SVGs array.
		 *
		 * @var woostify_svgs_arr
		 */
		private static $woostify_svgs_arr = null;

		/**
		 * Get an SVG Icon
		 *
		 * @param string $icon the icon name.
		 * @param bool   $echo echo icon.
		 */
		public static function fetch_svg_icon( $icon = '', $echo = true ) {
			$svg_output = '';

			if ( ! self::$woostify_svgs ) {
				ob_start();
				include_once WOOSTIFY_THEME_DIR . 'assets/svg/svgs.json'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
				self::$woostify_svgs     = json_decode( ob_get_clean(), true );
				self::$woostify_svgs     = apply_filters( 'woostify_svg_icons', self::$woostify_svgs );
				self::$woostify_svgs_arr = self::$woostify_svgs;
			}
			$svg_output .= isset( self::$woostify_svgs[ $icon ] ) ? self::$woostify_svgs[ $icon ] : '';

			$classes = array(
				'woostify-svg-icon',
				'icon-' . $icon,
			);

			$output = sprintf(
				'<span class="%1$s">%2$s</span>',
				implode( ' ', $classes ),
				$svg_output
			);

			if ( $echo ) {
				echo apply_filters( 'woostify_generate_svg_icon', $output, $icon ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
			} else {
				return apply_filters( 'woostify_generate_svg_icon', $output, $icon );
			}
		}

		/**
		 * Get all SVG Icon
		 */
		public static function fetch_all_svg_icon() {
			if ( ! self::$woostify_svgs_arr ) {
				ob_start();
				include_once WOOSTIFY_THEME_DIR . 'assets/svg/svgs.json'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude.FileIncludeFound
				self::$woostify_svgs_arr = json_decode( ob_get_clean(), true );
				self::$woostify_svgs     = self::$woostify_svgs_arr;
				self::$woostify_svgs_arr = apply_filters( 'woostify_svg_icons_arr', self::$woostify_svgs_arr );
			}

			return self::$woostify_svgs_arr;
		}
	}
}