/*
Theme Name:     Milky Design Child Theme
Theme URI:      https://milkydesign.ch
Description:    Milky Design Child Theme for customization
Author:         Milky Design
Author URI:     https://milkydesign.ch
Template:       milkydesign
Version:        1.0.0
Text Domain:    milkydesign-child
*/


/* Add your custom style below */

<?php

/* *************************************************************************************************
DO NOT REMOVE THIS FUNCTION. It calls the child theme's CSS file.
************************************************************************************************* */

function milkydesign_load_child_theme_styles() {
	if (!is_admin()) {
		$stylesheet_uri = get_stylesheet_directory_uri();

		wp_enqueue_style('milkydesign-child-theme-style', $stylesheet_uri . '/style.css', array(), '1.0.0');
	}
}
add_action('wp_enqueue_scripts', 'milkydesign_load_child_theme_styles', 1000);

/* ******************************************************************************************** */

// === COMPATIBILITÉ SOLIS CORE → MILKY DESIGN ===
// Créer des alias pour les anciennes fonctions SWM vers les nouvelles MD

if (!function_exists('swm_kses_allowed_text')) {
    function swm_kses_allowed_text() {
        if (function_exists('md_kses_allowed_text')) {
            return md_kses_allowed_text();
        }
        // Fallback basique si la fonction MD n'existe pas
        return array(
            'a' => array('href' => array(), 'title' => array(), 'class' => array()),
            'br' => array(),
            'em' => array(),
            'strong' => array(),
            'span' => array('class' => array()),
            'p' => array('class' => array()),
        );
    }
}

// Autres fonctions de compatibilité possibles
if (!function_exists('swm_kses_allowed_html')) {
    function swm_kses_allowed_html() {
        if (function_exists('md_kses_allowed_html')) {
            return md_kses_allowed_html();
        }
        return wp_kses_allowed_html('post');
    }
}

if (!function_exists('swm_kses_allowed_textarea')) {
    function swm_kses_allowed_textarea() {
        if (function_exists('md_kses_allowed_textarea')) {
            return md_kses_allowed_textarea();
        }
        return wp_kses_allowed_html('post');
    }
}



