File: /home/rasapedi/www/wp-content/themes/hello-theme-child-master/functions.php
<?php
/**
* Theme functions and definitions.
*
* For additional information on potential customization options,
* read the developers' documentation:
*
* https://developers.elementor.com/docs/hello-elementor-theme/
*
* @package HelloElementorChild
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
define( 'HELLO_ELEMENTOR_CHILD_VERSION', '2.0.0' );
/**
* Load child theme scripts & styles.
*
* @return void
*/
function hello_elementor_child_scripts_styles() {
wp_enqueue_style(
'hello-elementor-child-style',
get_stylesheet_directory_uri() . '/style.css',
[
'hello-elementor-theme-style',
],
HELLO_ELEMENTOR_CHILD_VERSION
);
}
add_action( 'wp_enqueue_scripts', 'hello_elementor_child_scripts_styles', 20 );
function rtlTextHasString($text, $string) {
return strpos($text, $string) !== false;
}
function rtlBlockExternalHostRequests ($false, $parsed_args, $url) {
$blockedHosts = [
'elementor.com',
'github.com',
'yoast.com',
'yoa.st',
'api.wordpress.org',
'w.org',
'unyson.io',
'siteorigin.com',
'woocommerce.com',
'api-eu.mixpanel.com',
'googleapis.com',
'cdn.jsdelivr.net',
'fonts.googleapis.com',
'cdnjs.cloudflare.com',
];
foreach ( $blockedHosts as $host ) {
if ( !empty($host) && rtlTextHasString($url, $host) ) {
return [
'headers' => '',
'body' => '',
'response' => '',
'cookies' => '',
'filename' => ''
];
}
}
return $false;
}
add_filter('pre_http_request', 'rtlBlockExternalHostRequests', 10, 3);