public function addField(Field $field)
    {
        $field
            ->setSection($this->currentSection)
            ->setOptionName($this->registry['option_name'])
        ;

        if (isset($this->registry['field_values'][$field->getId()])) {
            $field->setValue($this->registry['field_values'][$field->getId()]);
        }

        $this->registry['fields'][] = $field;

        return $this;
    }
public function addField(Field $field)
    {
        $field
            ->setSection($this->currentSection)
            ->setOptionName($this->registry['option_name'])
        ;

        if (isset($this->registry['field_values'][$field->getId()])) {
            $field->setValue($this->registry['field_values'][$field->getId()]);
        }

        $this->registry['fields'][] = $field;

        return $this;
    }
public function addField ( Field $ field ) { $ field -> setSection ( $ this -> currentSection ) -> setOptionName ( $ this -> registry [ 'option_name' ] ) ; if ( isset ( $ this -> registry [ 'field_values' ] [ $ field -> getId ( ) ] ) ) { $ field -> setValue ( $ this -> registry [ 'field_values' ] [ $ field -> getId ( ) ] ) ; } $ this -> registry [ 'fields' ] [ ] = $ field ; return $ this ; }
Adds a field

@param Field $field
@return SettingsPage
Adds a field