Give_Shortcode_Generator::get_fields PHP Method

get_fields() protected method

Get the generated shortcode dialog fields
Since: 1.0
protected get_fields ( ) : array
return array
    protected function get_fields()
    {
        $defined_fields = $this->define_fields();
        $generated_fields = $this->generate_fields($defined_fields);
        $errors = array();
        if (!empty($this->errors)) {
            foreach ($this->required as $name => $alert) {
                if (false === array_search($name, array_column($generated_fields, 'name'))) {
                    $errors[] = $this->errors[$name];
                }
            }
            $this->errors = $errors;
        }
        if (!empty($errors)) {
            return $errors;
        }
        return $generated_fields;
    }