HEX
Server: Apache/2.4.59 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2
System: Linux panel.ctvbarranquilla.com 5.15.0-102-generic #112-Ubuntu SMP Tue Mar 5 16:50:32 UTC 2024 x86_64
User: bastidas (1002)
PHP: 8.2.18
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,exec,system,passthru,shell_exec,proc_open,popen
Upload Files
File: /home/bastidas/web/bastidas.tv/public_html/wp-content/themes/ryan-eminimal/functions.php
<?php

// ----------------------------------------------------------------------------------
//	Register Front-End Styles And Scripts
// ----------------------------------------------------------------------------------

function ryan_thinkup_child_frontscripts() {

	wp_enqueue_style( 'thinkup-style', get_template_directory_uri() . '/style.css', array( 'thinkup-bootstrap', 'thinkup-shortcodes' ) );
	wp_enqueue_style( 'ryan-thinkup-style-eminimal', get_stylesheet_directory_uri() . '/style.css', array( 'thinkup-style' ), wp_get_theme()->get('Version') );
}
add_action( 'wp_enqueue_scripts', 'ryan_thinkup_child_frontscripts' );


// ----------------------------------------------------------------------------------
//	Hide blog options in customizer - Blog layout used
// ----------------------------------------------------------------------------------

function ryan_thinkup_child_adminscripts() {

	if ( is_customize_preview() ) {

		// Add theme stylesheets
		wp_enqueue_style( 'ryan-thinkup-child-backend', get_stylesheet_directory_uri() . '/styles/backend/style-backend.css', '', '' );

	}
}
add_action( 'admin_enqueue_scripts', 'ryan_thinkup_child_adminscripts' );


// ----------------------------------------------------------------------------------
//	Update Options Array With Child Theme Color Values
// ----------------------------------------------------------------------------------

// Add child theme settings to options array - UPDATED 20180819
function ryan_thinkup_updateoption_child_settings() {

	// Set theme name combinations
	$name_theme_upper = 'Ryan';
	$name_theme_lower = strtolower( $name_theme_upper );

	// Set possible options names
	$name_options_free  = 'thinkup_redux_variables';
	$name_options_child   = $name_theme_lower . '_thinkup_child_settings_eminimal';

	// Get options values (theme options)
	$options_free = get_option( $name_options_free );

	// Get child settinsg values
	$options_child_settings = get_option( $name_options_child );

	// Only set child settings values if not already set
	if ( $options_child_settings != 1 ) {

		// Assign as empty array if not set
		if( ! is_array( $options_free ) ) {
			$options_free = (array) null;
		}

		$options_free['thinkup_styles_skinswitch'] = '1';
		$options_free['thinkup_styles_skin']       = 'eminimal';
		$options_free['thinkup_blog_style']        = 'option2';
		$options_free['thinkup_blog_style2layout'] = 'option2';

		// Add child settings to theme options array
		update_option( $name_options_free, $options_free );

	}

	// Set the child settings flag
	update_option( $name_options_child, 1 );

}
add_action( 'init', 'ryan_thinkup_updateoption_child_settings', 999 );

// Remove child theme settings from options array - UPDATED 20180819
function ryan_thinkup_removeoption_child_settings() {

	// Assign default variable values
	$indicator_pro_installed = NULL;

	// Set theme name combinations
	$name_theme_upper = 'Ryan';
	$name_theme_lower = strtolower( $name_theme_upper );

	// Set possible options names
	$name_options_free  = 'thinkup_redux_variables';
	$name_options_child   = $name_theme_lower . '_thinkup_child_settings_eminimal';

	// Get options values (theme options)
	$options_free = get_option( $name_options_free );

	// Determine if Pro version is installed
	$themes = wp_get_themes();
	foreach ( $themes as $theme ) {
		if( $theme == $name_theme_upper . ' Pro' ) {
			$indicator_pro_installed = '1';
		}
	}

	// If Pro version is not installed then remove child settings on theme switch
	if ( $indicator_pro_installed !== '1' ) {

		$options_free['thinkup_styles_skinswitch'] = '';
		$options_free['thinkup_styles_skin']       = '';
		$options_free['thinkup_blog_style']        = '';
		$options_free['thinkup_blog_style2layout'] = '';

		// Add child settings to theme options array
		update_option( $name_options_free, $options_free );

	}

	// Delete the child settings flag
	delete_option( $name_options_child );

}
add_action('switch_theme', 'ryan_thinkup_removeoption_child_settings');