<?php
namespace Prk\Admin;

class ajax
{

    static function createChildTheme()
    {
        $res = [
            'code' => 400,
            'msg' => __('Has error', 'ahura')
        ];

        $createChildTheme = child_theme::createChildTheme();
        if(!$createChildTheme)
        {
            $res['msg'] = __('خطا در ساخت پوسته فرزند', 'parskala');
            wp_send_json($res);
        }
        // check is child theme active
        $currentTheme = wp_get_theme()->get_stylesheet();
        if($currentTheme !== 'parskala-child')
        {
            $res['msg'] = __("Child theme created but you must activate it from themes page", 'parskala');
            wp_send_json($res);
        }
        $res['msg'] = __('پوسته فرزند با موفقیت ساخته شد.', 'parskala');
        $res['code'] = 200;
        wp_send_json($res);
    }
}