<?php
/**
 * Flatsome functions and definitions
 *
 * @package flatsome
 */

add_action('admin_head-edit-tags.php', function () {
    ?>
    <style>
        .term-description-wrap,
        .term-description-wrap textarea {
            display: none !important;
        }
    </style>
    <?php
});



add_filter('category_edit_form_fields', function ($term) {

    $content = htmlspecialchars_decode($term->description);
    ?>
    <tr class="form-field">
        <th scope="row"><label for="description"><?php _e('Description'); ?></label></th>
        <td>
            <?php
            wp_editor(
                $content,
                'new_category_description',
                array(
                    'textarea_name' => 'description', // THIS makes WP use this editor to save description
                    'media_buttons' => true,
                    'textarea_rows' => 10,
                    'tinymce' => true,
                    'quicktags' => true,
                )
            );
            ?>
        </td>
    </tr>
    <?php
});
add_action('admin_head-edit-tags.php', function () {
    ?>
    <style>
        .term-description-wrap,
        .term-description-wrap textarea {
            display: none !important;
        }
    </style>
    <?php
});

add_filter('category_edit_form_fields', function ($term) {

    $content = htmlspecialchars_decode($term->description);
    ?>
    <tr class="form-field">
        <th scope="row"><label for="description"><?php _e('Description'); ?></label></th>
        <td>
            <?php
            wp_editor(
                $content,
                'new_category_description',
                array(
                    'textarea_name' => 'description', // THIS makes WP use this editor to save description
                    'media_buttons' => true,
                    'textarea_rows' => 10,
                    'tinymce' => true,
                    'quicktags' => true,
                )
            );
            ?>
        </td>
    </tr>
    <?php
});


require get_template_directory() . '/inc/init.php';

flatsome()->init();

/**
 * It's not recommended to add any custom code here. Please use a child theme
 * so that your customizations aren't lost during updates.
 *
 * Learn more here: https://developer.wordpress.org/themes/advanced-topics/child-themes/
 */
