HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
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'] );
			}
		}
	}
}