403Webshell
Server IP : 146.59.209.152  /  Your IP : 216.73.216.46
Web Server : Apache
System : Linux webm005.cluster131.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User : infrafs ( 43850)
PHP Version : 8.2.29
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/infrafs/bike/wp-content/plugins/colibri-page-builder/extend-builder/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/infrafs/bike/wp-content/plugins/colibri-page-builder/extend-builder/fonts.php
<?php

namespace ExtendBuilder;

use ColibriWP\PageBuilder\GoogleFontsLocalLoader;

add_filter('extend_builder/google_fonts', function ($fonts) {
	$page_fonts = array();
	$data = get_current_data();

	foreach ($data['partials'] as $partial_type => $partial) {
		$partial_fonts = array_get_value($partial, 'meta.fonts.google');
		if ($partial_fonts) {
			$page_fonts = array_merge_recursive($page_fonts, $partial_fonts);
		}
	}

	//global fonts//
	$theme_fonts = array_get_value($data, 'options.theme.fonts.google');
    $fonts = array_merge_recursive($page_fonts, $theme_fonts);

    return $fonts;
});


function enqueue_google_fonts()
{
    
    $fonts = array();
    $fonts = apply_filters("extend_builder/google_fonts", $fonts);

    if (!count($fonts)) {
        return;
    }

    $fontQuery = array();
    foreach ($fonts as $family => $font) {
        $fontQuery[] = $family . ":" . implode(',', $font['weights']);
    }


	$data = get_current_data();
	$use_local_fonts = array_get_value($data, 'options.theme.global.googleFonts.serveLocally', false);
	if(!$use_local_fonts) {

		$query_args = array(
			'family' => urlencode(implode('|', $fontQuery)),
			'subset' => urlencode('latin,latin-ext'),
			'display'=> 'swap'
		);


		$fontsURL = add_query_arg($query_args, 'https://fonts.googleapis.com/css');
		wp_enqueue_style(prefix() . '-fonts', $fontsURL, array(), null);
	} else {
		$fontsQueryString = implode('|', $fontQuery);
		GoogleFontsLocalLoader::enqueuLocalGoogleFonts( $fontsQueryString );
	}

}

add_action('wp_enqueue_scripts', '\ExtendBuilder\enqueue_google_fonts');

Youez - 2016 - github.com/yon3zu
LinuXploit