HEX
Server: Apache/2.4.34 (Red Hat) OpenSSL/1.0.2k-fips
System: Linux WORDPRESS 3.10.0-1160.118.1.el7.x86_64 #1 SMP Thu Apr 4 03:33:23 EDT 2024 x86_64
User: digital (1020)
PHP: 7.2.24
Disabled: NONE
Upload Files
File: /datos/www/expodubai/wp-content/themes/osapa-childOld/functions.php
<?php
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;

// BEGIN ENQUEUE PARENT ACTION
// AUTO GENERATED - Do not modify or remove comment markers above or below:

if ( !function_exists( 'chld_thm_cfg_locale_css' ) ):
    function chld_thm_cfg_locale_css( $uri ){
        if ( empty( $uri ) && is_rtl() && file_exists( get_template_directory() . '/rtl.css' ) )
            $uri = get_template_directory_uri() . '/rtl.css';
        return $uri;
    }
endif;
add_filter( 'locale_stylesheet_uri', 'chld_thm_cfg_locale_css' );

if ( !function_exists( 'chld_thm_cfg_parent_css' ) ):
    function chld_thm_cfg_parent_css() {
        wp_enqueue_style( 'chld_thm_cfg_parent', trailingslashit( get_template_directory_uri() ) . 'style.css', array( 'simple-line-icons','font-awesome','pe-icon-7-stroke','owl-carousel','pretty-photo','photoswipe-default','editor-styles' ) );
    }
endif;
add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css', 1000 );

// END ENQUEUE PARENT ACTION


/* Remplazar funcion original del tema padre */
if (!function_exists('osapa_theme_logo')) {
    function osapa_theme_logo() {
        global $smof_data;

        // Obtener el idioma actual
        if (function_exists('pll_current_language')) {
            $idioma = pll_current_language();
        } elseif (defined('ICL_LANGUAGE_CODE')) {
            $idioma = ICL_LANGUAGE_CODE;
        } else {
            $idioma = substr(get_locale(), 0, 2); // Alternativa basada en el locale
        }

        // Definir la URL del logo según el idioma
        if ($idioma == 'en') {
            $logo_image = 'https://colombiaexpoosaka.com/wp-content/uploads/2025/03/logo-pais-belleza-eng.png'; // Logo en inglés hardcoded
        } else {
            $logo_image = isset($smof_data['ftc_logo']['url']) ? esc_url($smof_data['ftc_logo']['url']) : '';
        }

        $logo_text = isset($smof_data['ftc_text_logo']) ? stripslashes(esc_attr($smof_data['ftc_text_logo'])) : '';
        ?>
        <div class="logo">
            <a href="<?php echo esc_url(home_url('/')); ?>">
                <!-- Main logo -->
                <?php if (!empty($logo_image)): ?>
                    <img src="<?php echo esc_url($logo_image); ?>" alt="<?php echo !empty($logo_text) ? esc_attr($logo_text) : get_bloginfo('name'); ?>" class="normal-logo" />
                <?php endif; ?>

                <!-- Logo Text -->
                <?php
                if (empty($logo_image)) {
                    echo esc_html($logo_text);
                }
                ?>
            </a>
        </div>
        <?php
    }
}

if (!function_exists('osapa_theme_logo_mobile')) {
    function osapa_theme_logo_mobile() {
        global $smof_data;

        // Obtener el idioma actual
        if (function_exists('pll_current_language')) {
            $idioma = pll_current_language();
        } elseif (defined('ICL_LANGUAGE_CODE')) {
            $idioma = ICL_LANGUAGE_CODE;
        } else {
            $idioma = substr(get_locale(), 0, 2);
        }

        // Definir la URL del logo según el idioma
        if ($idioma == 'en') {
            $logo_image = 'https://colombiaexpoosaka.com/wp-content/uploads/2025/03/logo-pais-belleza-eng.png'; // Logo en inglés hardcoded
        } else {
            $logo_image = isset($smof_data['ftc_logo_mobile']['url']) ? esc_url($smof_data['ftc_logo_mobile']['url']) : '';
        }

        $logo_text = isset($smof_data['ftc_text_logo']) ? stripslashes(esc_attr($smof_data['ftc_text_logo'])) : '';
        ?>
        <div class="logo">
            <a href="<?php echo esc_url(home_url('/')); ?>">
                <!-- Main logo -->
                <?php if (!empty($logo_image)): ?>
                    <img src="<?php echo esc_url($logo_image); ?>" alt="<?php echo !empty($logo_text) ? esc_attr($logo_text) : get_bloginfo('name'); ?>" class="normal-logo" />
                <?php endif; ?>

                <!-- Logo Text -->
                <?php
                if (empty($logo_image)) {
                    echo esc_html($logo_text);
                }
                ?>
            </a>
        </div>
        <?php
    }
}