Elementor\Admin::ajax_elementor_deactivate_feedback PHP Метод

ajax_elementor_deactivate_feedback() публичный Метод

    public function ajax_elementor_deactivate_feedback()
    {
        if (!isset($_POST['_wpnonce']) || !wp_verify_nonce($_POST['_wpnonce'], '_elementor_deactivate_feedback_nonce')) {
            wp_send_json_error();
        }
        $reason_text = $reason_key = '';
        if (!empty($_POST['reason_key'])) {
            $reason_key = $_POST['reason_key'];
        }
        if (!empty($_POST["reason_{$reason_key}"])) {
            $reason_text = $_POST["reason_{$reason_key}"];
        }
        Api::send_feedback($reason_key, $reason_text);
        wp_send_json_success();
    }