<?php

class feature
{
    public static function ajax_add_feature()
    {
        $name = $_POST['name'];
        wp_send_json(feature::add_feature($name));
    }

    public static function add_feature($name)
    {
        global $wpdb;
        $result = $wpdb->insert(Config::TOSPUR_TAG_TABLE, array(
            'name' => $name,
            'type' => 1
        ));
        return $result;
    }

    public static function feature_html()
    {
        $context = array();
        $context['url'] = home_url();
        Timber::render('feature.html', $context);
    }
}

?>