File: /var/www/html/insiders/wp-load/wp-content/plugins/gutenmate/lib/custom-code.php
<?php
add_action( 'wp_enqueue_scripts', 'gtm_include_custom_scripts', 99 );
function gtm_include_custom_scripts() {
$scripts = get_option( 'gtm_custom_scripts', [] );
if ( ! empty( $scripts ) ) {
wp_register_script( 'gtm-custom-scripts', '', [], false, true );
wp_enqueue_script( 'gtm-custom-scripts' );
foreach ( $scripts as $script ) {
if ( $script['enable'] && ! empty( $script['code'] ) ) {
wp_add_inline_script( 'gtm-custom-scripts', ';' . $script['code'] . ';' );
}
}
}
}
add_action( 'wp_enqueue_scripts', 'gtm_include_custom_styles', 99 );
function gtm_include_custom_styles() {
$styles = get_option( 'gtm_custom_styles', [] );
if ( ! empty( $styles ) ) {
foreach ( $styles as $style ) {
if ( $style['enable'] && ! empty( $style['code'] ) ) {
wp_add_inline_style( 'gtm-custom-css',$style['code'] );
}
}
}
}