Save meta fields after WordPress saves a term
Note: this is fired *after* WordPress has already saved the term
@param bool $exclude_core
@return integer term ID
977738
public function save($exclude_core = false)
    {
        if (count($this->_info) === 0) {
            return false;
        }

        // set defaults
        $defaults = $this->getDefaults();
        if (count($defaults) > 0) {
            foreach ($defaults as $k => $v) {
                if (!array_key_exists($k, $this->_info)) {
                    $this->_info[$k] = $v;
                }
            }
        }

        // separate core fields from extra
        $core = array();
        $extra = array();
        $core_fields = static::getCoreFieldKeys();
        $extra_fields = array_keys($this->getFields());
        foreach ($this->_info as $k => $v) {
            if (in_array($k, $core_fields)) {
                $core[$k] = $v;
            } elseif (in_array($k, $extra_fields)) {
                $extra[$k] = $v;
            }
        }

        // save core fields
        if (!empty($core[self::ID])) {
          $term_exists = term_exists($core[self::ID], $this->getTaxonomyKey());
          if ($term_exists) {
            $this->set(self::ID, $term_exists[self::ID]);
          }
        }

        $is_update = (bool) $this->get(self::ID);
        if (!$exclude_core) {
            if (!array_key_exists(self::ID, $core)) {
                $core[self::ID] = (int) $this->get(self::ID);
            }
            if ($is_update) {
                wp_update_term($core[self::ID], $this->getTaxonomyKey(), $core);
            } else {
                $name = $core['name'];
                unset($core['name']);
                $res = wp_insert_term($name, $this->getTaxonomyKey(), $core);
                $this->_info[self::ID] = current($res);
            }
        }

        // Create option for meta field values in wp_options table
        if (count($extra) > 0) {
            delete_option($this->getOptionID($this->get(self::ID)));
            add_option($this->getOptionID($this->get(self::ID)), $extra);
        }

        return $this->_info[self::ID];
    }
529127
protected function saveTermMultipleValue($value, int $term_id)
    {
        $previous = get_term_meta($term_id, $this->getName(), false);

        if (is_null($value) || empty($value)) {
            delete_term_meta($term_id, $this->getName());
        } elseif (empty($previous) && is_array($value)) {
            array_walk($value, function ($val) use ($term_id) {
                add_term_meta($term_id, $this->getName(), $val, false);
            });
        } else {
            delete_term_meta($term_id, $this->getName());

            array_walk($value, function ($val) use ($term_id) {
                add_term_meta($term_id, $this->getName(), $val, false);
            });
        }
    }
67796
public function assocConfig($include_extra = false)
    {
        // Load the config data if it isn't already
        if (!$this->config) {
            $this->loadConfig();
        }

        // Loop through the YAML config and make flattened keys.  The ternary
        // operators in here allow a shorthand version of the YAML config as
        // described in the docs.
        $config = [];
        foreach ($this->config as $page => $page_data) {
            foreach (isset($page_data['sections']) ? $page_data['sections'] : $page_data as $section => $section_data) {
                foreach (isset($section_data['fields']) ? $section_data['fields'] : $section_data as $field => $field_data) {

                    // Determine the type of field
                    $field_parts = explode(',', $field);
                    $field = $field_parts[0];
                    if (count($field_parts) == 2) {
                        $type = $field_parts[1];
                    } // If concatted onto the field name
                    elseif (is_array($field_data) && isset($field_data['type'])) {
                        $type = $field_data['type'];
                    } // Explicitly set
                    else {
                        $type = 'text';
                    } // Default type

                    // Determine the value
                    if (is_array($field_data) && array_key_exists('value', $field_data)) {
                        $value = $field_data['value'];
                    } elseif (is_scalar($field_data)) {
                        $value = $field_data;
                    } // String, boolean, int, etc
                    else {
                        $value = null;
                    }

                    // Build the value array
                    $el = ['type' => $type, 'value' => $value];
                    if ($this->has_extra || $include_extra) {
                        $this->mergeExtra($el, $field, $field_data);
                        $this->mergeExtra($el, $section, $section_data, 'section_');
                        $this->mergeExtra($el, $page, $page_data, 'page_');
                        $el['rules'] = isset($field_data['rules']) ? $field_data['rules'] : null;
                    }

                    // Add the config
                    $config["{$page}.{$section}.{$field}"] = $el;
                }
            }
        }

        // Return the flattened config
        return $config;
    }
228161
public static function urlize($text, $separator = '-', $excludeTwig = false)
    {
        $text = parent::unaccent($text);

        return self::postProcessText($text, $separator, $excludeTwig);
    }
260557
public function get_meta( $object_type, $_null = null, $object_id = 0, $meta_key = '', $single = false ) {

		// Enforce boolean as it can be a string sometimes
		$single = filter_var( $single, FILTER_VALIDATE_BOOLEAN );

		$meta_type = $object_type;

		if ( in_array( $meta_type, array( 'post_type', 'media' ) ) ) {
			$meta_type = 'post';
		} elseif ( 'taxonomy' == $meta_type ) {
			$meta_type = 'term';
		}

		if ( empty( $meta_key ) ) {
			if ( ! defined( 'PODS_ALLOW_FULL_META' ) || ! PODS_ALLOW_FULL_META ) {
				return $_null; // don't cover get_post_meta( $id )
			}

			$single = false;
		}

		if ( 'user' === $object_type && 'locale' === $meta_key ) {
			return $_null; // don't interfere with locale
		}

		$object = $this->get_object( $object_type, $object_id );

		if ( empty( $object_id ) || empty( $object ) ) {
			return $_null;
		}

		$no_conflict = pods_no_conflict_check( $meta_type );

		if ( ! $no_conflict ) {
			pods_no_conflict_on( $meta_type );
		}

		$meta_cache = array();

		if ( ! $single && isset( $GLOBALS['wp_object_cache'] ) && is_object( $GLOBALS['wp_object_cache'] ) ) {
			$meta_cache = wp_cache_get( $object_id, 'pods_' . $meta_type . '_meta' );

			if ( empty( $meta_cache ) ) {
				$meta_cache = wp_cache_get( $object_id, $meta_type . '_meta' );

				if ( empty( $meta_cache ) ) {
					$meta_cache = update_meta_cache( $meta_type, array( $object_id ) );
					$meta_cache = $meta_cache[ $object_id ];
				}
			}
		}

		if ( empty( $meta_cache ) || ! is_array( $meta_cache ) ) {
			$meta_cache = array();
		}

		if ( ! is_object( self::$current_field_pod ) || self::$current_field_pod->pod != $object['name'] ) {
			self::$current_field_pod = pods( $object['name'], $object_id );
		} elseif ( self::$current_field_pod->id() != $object_id ) {
			self::$current_field_pod->fetch( $object_id );
		}

		$pod = self::$current_field_pod;

		$meta_keys = array( $meta_key );

		if ( empty( $meta_key ) ) {
			$meta_keys = array_keys( $meta_cache );
		}

		$key_found = false;

		foreach ( $meta_keys as $meta_k ) {
			if ( ! empty( $pod ) ) {
				if ( isset( $pod->fields[ $meta_k ] ) ) {
					$key_found = true;

					$meta_cache[ $meta_k ] = $pod->field( array(
						'name'     => $meta_k,
						'single'   => $single,
						'get_meta' => true
					) );

					if ( ( ! is_array( $meta_cache[ $meta_k ] ) || ! isset( $meta_cache[ $meta_k ][0] ) ) ) {
						if ( empty( $meta_cache[ $meta_k ] ) && ! is_array( $meta_cache[ $meta_k ] ) && $single ) {
							$meta_cache[ $meta_k ] = array();
						} else {
							$meta_cache[ $meta_k ] = array( $meta_cache[ $meta_k ] );
						}
					}

					if ( in_array( $pod->fields[ $meta_k ]['type'], PodsForm::tableless_field_types() ) && isset( $meta_cache[ '_pods_' . $meta_k ] ) ) {
						unset( $meta_cache[ '_pods_' . $meta_k ] );
					}
				} elseif ( false !== strpos( $meta_k, '.' ) ) {
					$key_found = true;

					$first = current( explode( '.', $meta_k ) );

					if ( isset( $pod->fields[ $first ] ) ) {
						$meta_cache[ $meta_k ] = $pod->field( array(
							'name'     => $meta_k,
							'single'   => $single,
							'get_meta' => true
						) );

						if ( ( ! is_array( $meta_cache[ $meta_k ] ) || ! isset( $meta_cache[ $meta_k ][0] ) ) && $single ) {
							if ( empty( $meta_cache[ $meta_k ] ) && ! is_array( $meta_cache[ $meta_k ] ) && $single ) {
								$meta_cache[ $meta_k ] = array();
							} else {
								$meta_cache[ $meta_k ] = array( $meta_cache[ $meta_k ] );
							}
						}

						if ( in_array( $pod->fields[ $first ]['type'], PodsForm::tableless_field_types() ) && isset( $meta_cache[ '_pods_' . $first ] ) ) {
							unset( $meta_cache[ '_pods_' . $first ] );
						}
					}
				}
			}
		}

		if ( ! $no_conflict ) {
			pods_no_conflict_off( $meta_type );
		}

		unset( $pod ); // memory clear

		if ( ! $key_found ) {
			return $_null;
		}

		if ( ! $single && isset( $GLOBALS['wp_object_cache'] ) && is_object( $GLOBALS['wp_object_cache'] ) ) {
			wp_cache_set( $object_id, $meta_cache, 'pods_' . $meta_type . '_meta' );
		}

		if ( empty( $meta_key ) ) {
			return $meta_cache;
		} elseif ( isset( $meta_cache[ $meta_key ] ) ) {
			$value = $meta_cache[ $meta_key ];
		} else {
			$value = '';
		}

		if ( ! is_numeric( $value ) && empty( $value ) ) {
			if ( $single ) {
				$value = '';
			} else {
				$value = array();
			}
		} // get_metadata requires $meta[ 0 ] to be set for first value to be retrieved
		elseif ( ! is_array( $value ) ) {
			$value = array( $value );
		}

		return $value;
	}
226555
public function save( $post_id ) 
    {
        /**
         * A note on security:
         * 
         * We need to verify this came from the our screen and with proper authorization,
         * because save_post can be triggered at other times. since metaboxes can 
         * be removed - by having a nonce field in only one metabox there is no 
         * guarantee the nonce will be there. By placing a nonce field in each 
         * metabox you can check if data from that metabox has been sent 
         * (and is actually from where you think it is) prior to processing any data.
         * @see http://wordpress.stackexchange.com/a/49460/25959
         */
        
        // Check if our nonce is set.
        if ( ! isset( $_POST[$this->nonce_name()] ) )
        {
            return $post_id;
        }

        // Verify that the nonce is valid.
        $nonce = filter_input( INPUT_POST, $this->nonce_name() );
        if ( ! wp_verify_nonce( $nonce, $this->action_name() ) )
        {
            return $post_id;
        }
        
        // Bail if this is an autosave (nothing has been submitted)
        if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
        {
            return $post_id;
        }
        
        // Check the user's permissions.
        $post_type = filter_input( INPUT_POST, 'post_type' );
        if( in_array( $post_type, $this->settings['post_types'] ) )
        {
            // NOTE: this might not work for custom post types, unless Amarkal
            // is used to register them (custom post types might have labels different 
            // than 'edit_{post_type}'
            $capability = 'edit_'.$post_type;
            if ( !current_user_can( $capability, $post_id ) )
            {
                return $post_id;
            }
        }
        else
        {
            return $post_id;
        }

        // OK, it is safe to process data.
        $old_instance = \get_post_meta( $post_id, $this->settings['id'], true );
        $new_instance = $this->form->updater->update( $old_instance === "" ? array() : $old_instance );
        \update_post_meta( $post_id, $this->settings['id'], $new_instance );
        
        // Callback
        $callable = $this->settings['callback'];
        if(is_callable( $callable ) )
        {
            $callable( $post_id, $new_instance );
        }
    }
1168828
public function savePostMetaToDatabase($postmeta, $postTypeModel, $post, $request = [], $customFieldKey = '')
	{
		// Presetting a empty array so we can append pivot values to the sync function.
		$pivotValue = [];
		$object = [];

		$postmeta = $this->removeUnrequiredMetas($postmeta, $postTypeModel);

		if(!empty($customFieldKey)){
			if($request->hasFile('file')){
				$postmeta[$customFieldKey] = '';
			}
		}

		// Saving the meta values to the database.
		foreach($postmeta as $key => $value){

			$customFieldObject = $this->getCustomFieldObject($postTypeModel, $key);
			if($customFieldObject){
				if(array_key_exists('saveable', $customFieldObject)){
					if($customFieldObject['saveable'] === false){
						continue;
					}
				}
			}

			// Lets validate if there is a mutator for this value.
			$value = $this->saveMutator($postTypeModel, $key, $value, $post, $postmeta, $request);

			// If the custom field does not exist, we may not save it.
			$customFieldObject = $this->getCustomFieldObject($postTypeModel, $key);
			if(!is_array($customFieldObject)){
				continue;
			}

			$type = 'simple';
			if(array_key_exists('type', $customFieldObject)){
				$type = $customFieldObject['type'];
			}
			switch($type){
				case 'taxonomy':

					if(!array_key_exists('post_type', $customFieldObject) && empty($customFieldObject['post_type'])){
						continue;
					}

					$customfieldPostTypes = $this->getPostTypeIdentifiers($customFieldObject['post_type']);

					if(!is_array($customfieldPostTypes)){
						continue;
					}

					if(!is_array($value)){
						$value = json_decode($value, true);
					}

					// Yes, double.
					if(!is_array($value)){
						continue;
					}

					foreach($value as $valueKey => $valueItem){

						$where = [];

						if($postTypeModel->userCanOnlySeeHisOwnPosts){
							$where[] = ['post_author', '=', Auth::user()->id];
						}

						$where[] = ['id', '=', $valueItem];

						// For each post id give, we need to query the database and validate if this
						// taxonomie of the connect post does exist and we got permission to it.
						$taxonomyPost = NikuPosts::where($where)
							->whereIn('post_type', $customfieldPostTypes)
							->first();

						// If there is a taxonomy result, we can safely add it to the pivot.
						if($taxonomyPost) {
							$pivotValue[$valueItem] = ['taxonomy' => $key];
						}

					}

					$post->taxonomies()->sync($pivotValue);

				break;
				default:

					$object[$key] = $value;

				break;
			}

		}

		$post->saveMetas($object);

		return $post;
	}
797151
public function save_taxonomy_track_changed_fields( $term_id, $taxonomy ) {

		$no_conflict = pods_no_conflict_check( 'term' );

		if ( ! $no_conflict ) {
			$pod = $taxonomy;
			$id  = $term_id;

			PodsAPI::handle_changed_fields( $pod, $id, 'reset' );
		}

	}
769973
public static function get_custom_field_data( $post_id ) {

		global $post;
		if ( ! is_object( $post ) ) {
			$post = get_post( $post_id );
		}

		$raw_data = get_post_meta( $post_id  );

		if ( ! is_array( $raw_data ) ) {
			return;

		}
		
		// init the data array		
		$template_data = array();

		// add taxonomies in with a :taxonomy alias
		$taxonomies = get_object_taxonomies( $post );
		if( !empty( $taxonomies ) ){
			foreach ( $taxonomies as $taxonomy_name  ) {

				$taxonomy = get_taxonomy( $taxonomy_name );
				$template_data['taxonomy'][ $taxonomy_name ] = $template_data[ $taxonomy_name ] = wp_get_post_terms( $post->ID, $taxonomy_name, array("fields" => "all") );

			}
		}

		// break to standard arrays
		foreach( $raw_data as $meta_key=>$meta_data ){

			if( count( $meta_data ) === 1 ){
				if( strlen( trim( $meta_data[0] ) ) > 0 ){ // check value is something else leave it out.
					$template_data[$meta_key] = trim( $meta_data[0] );
				}
			}else{
				$template_data[$meta_key] = $meta_data;
			}
		}
		// ACF support
		if( class_exists( 'acf' ) ){
			$fields = get_fields( $post->ID );
			if ( is_array( $fields ) && ! empty( $fields ) ) {
				$template_data = array_merge( $template_data, $fields );
			}

		}
		// CFS support
		if( class_exists( 'Custom_Field_Suite' ) ){
			$fields = CFS()->get();
			if ( is_array( $fields ) && ! empty( $fields ) ) {
				$template_data = array_merge( $template_data, $fields );
			}

		}

		//Pods support
		if ( class_exists( 'Pods' ) && false != ( $pods = pods( $post->post_type, $post->ID, true ) ) ) {
			$fields = $pods->export();
			if ( is_array( $fields ) && ! empty( $fields ) ) {
				$template_data = array_merge( $template_data, $fields );
			}

		}


		// include post values if in a post
		if( !empty( $post ) ){
			foreach( $post as $post_key=>$post_value ){
				$template_data[$post_key] = $post_value;
			}
			// author details
			$template_data['post_author'] = get_userdata( $template_data['post_author'] );
			// add permalink
			$template_data['permalink'] = get_permalink( $post->ID );
			// core post object
			$template_data['post_format'] = get_post_format( $post );

		}

		return $template_data;

	}
94840
def save(self, *args, **kwargs):
        '''
        '''
        if not self.term in self.DCELEMENT_CODE_MAP:
            raise ValueError('Extended Dublin Core Terms such as '+self.DCTERM_CODE_MAP[self.term]+' are not allowed. Please use only Dublin Core Elements')
        #HOW TO TELL IF OBJECT CHANGED? RETRIEVE FROM DB and COMPARE
        changed = False
        if self.pk:# existing object
            db_self = QualifiedDublinCoreElement.objects.get(pk=self.pk)
            #compare values, if changed set changed!
            if self.term != db_self.term:
                raise ValueError('Can not change DC element')
            if self.content != db_self.content:
                changed = True
            if self.qualifier != db_self.qualifier:
                changed = True
            if changed:
                hist = QualifiedDublinCoreElementHistory()
                hist.qdce = self
                hist.object_id = db_self.object_id
                hist.content_type = db_self.content_type
                hist.term = db_self.term
                hist.qualifier = db_self.qualifier
                hist.content  = db_self.content
                hist.save()
        super(QualifiedDublinCoreElement, self).save(*args, **kwargs)
        obj = self.content_object
        if hasattr(obj, '_save_dc_xml_file'):
            obj._save_dc_xml_file()
806276
function is_protected_meta( $protected, $meta_key, $meta_type ) {
		
		// globals
		global $post;
		
		
		// if acf_get_field_reference returns a valid key, this is an acf value, so protect it!
		if( !$protected ) {
			
			$reference = get_field_reference( $meta_key, $post->ID );
			
			if( substr($reference, 0, 6) === 'field_' ) {
				
				$protected = true;
				
			} 
			
		}
		
		
		// return
		return $protected;
				
	}
566364
function exclude(array $exclusionFields = [], $exclusionBehave = self::EXCLUDE_DISALLOW)
    {
        $exclude = [];
        foreach ($this->value as $field => $term)
        {
            if (!empty($exclusionFields))
            {
                $flag = in_array($field, $exclusionFields);

                ($exclusionBehave != self::EXCLUDE_ALLOW) ?: $flag = !$flag;

                if ($flag)
                    // The Field not considered as Expression Term
                    continue;
            }

            $exclude[$field] = $term;

        }// end foreach


        return new StdArray($exclude);
    }
634837
protected function saveCustomFields(): bool
    {
        //find the custom field module
        if (!$module = Modules::findFirstByName($this->getSource())) {
            return false;
        }

        //we need a new instane to avoid overwrite
        $reflector = new \ReflectionClass($this);
        $classNameWithNameSpace = $reflector->getNamespaceName() . '\\' . $reflector->getShortName() . 'CustomFields';

        //if all is good now lets get the custom fields and save them
        foreach ($this->customFields as $key => $value) {
            //create a new obj per itration to se can save new info
            $customModel = new $classNameWithNameSpace();

            //validate the custome field by it model
            if ($customField = CustomFields::findFirst(['conditions' => 'name = ?0 and modules_id = ?1', 'bind' => [$key, $module->id]])) {
                //throw new Exception("this custom field doesnt exist");

                $customModel->setCustomId($this->getId());
                $customModel->custom_fields_id = $customField->id;
                $customModel->value = $value;
                $customModel->created_at = date('Y-m-d H:i:s');

                if (!$customModel->save()) {
                    throw new Exception('Custome ' . $key . ' - ' . $this->customModel->getMessages()[0]);
                }
            }
        }

        //clean
        unset($this->customFields);

        return true;
    }
113861
public function storeMeta($metaData, $metaType, $metaId, $metaModel = Meta::class)
    {
        // Validation required instead of type hinting because it could be passed as false or NULL
        if (!is_array($metaData)) {
            return;
        }

        foreach ($metaData as $key => $value) {
            $modelInstance = call_user_func(
                [$metaModel, 'firstOrNew'],
                [
                    'key'       => $key,
                    'meta_type' => $metaType,
                    'meta_id'   => $metaId,
                ]
            );

            $value = $this->removeEmptyValues($value);
            if (!empty($value)) {
                $modelInstance->setAttribute('value', $value);
                $modelInstance->save();
                continue;
            }

            // The value is empty, remove the row
            if ($modelInstance->exists) {
                $modelInstance->delete();
            }
        }
    }
97975
public function set($attributes = array(), $exclude = [])
    {
        //Remove any empty elements and keys specified in the $exclude array before generating meta tag
        $attributes = array_filter($attributes, function ($value, $key) use ($exclude) {
            return !empty($value) && !in_array($key, $exclude);
        }, ARRAY_FILTER_USE_BOTH);

        $this->attributes = array_replace_recursive($this->attributes, $attributes);

        return $this->attributes;
    }
981598
public function save_options() {
		if ( ! filter_input( INPUT_POST, 'submit' ) ) {
			return false;
		}

		if ( ! wp_verify_nonce( filter_input( INPUT_POST, '_wpnonce' ), 'update-permalink' ) ) {
			return false;
		}

		if ( false === strpos( filter_input( INPUT_POST, '_wp_http_referer' ), 'options-permalink.php' ) ) {
			return false;
		}

		$post_types = CPTP_Util::get_post_types();

		foreach ( $post_types as $post_type ) :

			$structure = trim( esc_attr( filter_input( INPUT_POST, $post_type . '_structure' ) ) ); // get setting.

			// default permalink structure.
			if ( ! $structure ) {
				$structure = CPTP_DEFAULT_PERMALINK;
			}

			$structure = str_replace( '//', '/', '/' . $structure );// first "/"
			// last "/".
			$lastString = substr( trim( esc_attr( filter_input( INPUT_POST,'permalink_structure' ) ) ), - 1 );
			$structure  = rtrim( $structure, '/' );

			if ( '/' === $lastString ) {
				$structure = $structure . '/';
			}

			update_option( $post_type . '_structure', $structure );
		endforeach;
		$no_taxonomy_structure = ! filter_input( INPUT_POST, 'no_taxonomy_structure' );
		$add_post_type_for_tax = filter_input( INPUT_POST, 'add_post_type_for_tax' );

		update_option( 'no_taxonomy_structure', $no_taxonomy_structure );
		update_option( 'add_post_type_for_tax', $add_post_type_for_tax );
		update_option( 'cptp_permalink_checked', CPTP_VERSION );
	}
1246135
protected function addStandardDescFields($exclude = array())
    {
        if (! \in_array('locale', $exclude)) {
            $this->formBuilder->add(
                'locale',
                'hidden',
                [
                    'constraints' => [ new NotBlank() ],
                    'required'    => true,
                ]
            );
        }

        if (! \in_array('title', $exclude)) {
            $this->formBuilder->add(
                'title',
                'text',
                [
                    'constraints' => [ new NotBlank() ],
                    'required'    => true,
                    'label'       => Translator::getInstance()->trans('Title'),
                    'label_attr'  => [
                        'for' => 'title_field',
                    ],
                    'attr' => [
                        'placeholder' => Translator::getInstance()->trans('A descriptive title'),
                    ]
                ]
            );
        }

        if (! \in_array('chapo', $exclude)) {
            $this->formBuilder->add(
                'chapo',
                'textarea',
                [
                    'constraints' => [ ],
                    'required'    => false,
                    'label'       => Translator::getInstance()->trans('Summary'),
                    'label_attr'  => [
                        'for'         => 'summary_field',
                        'help'        => Translator::getInstance()->trans('A short description, used when a summary or an introduction is required'),
                    ],
                    'attr' => [
                        'rows'        => 3,
                        'placeholder' => Translator::getInstance()->trans('Short description text'),
                    ]
                ]
            );
        }

        if (! \in_array('description', $exclude)) {
            $this->formBuilder->add(
                'description',
                'textarea',
                [
                    'constraints' => [ ],
                    'required'    => false,
                    'label'       => Translator::getInstance()->trans('Detailed description'),
                    'label_attr'  => [
                        'for'  => 'detailed_description_field',
                        'help' => Translator::getInstance()->trans('The detailed description.'),
                    ],
                    'attr' => [
                        'rows' => 10,
                    ]
                ]
            );
        }

        if (! \in_array('postscriptum', $exclude)) {
            $this->formBuilder->add(
                'postscriptum',
                'textarea',
                [
                    'constraints' => [ ],
                    'required'    => false,
                    'label'       => Translator::getInstance()->trans('Conclusion'),
                    'label_attr'  => [
                        'for'         => 'conclusion_field',
                        'help'        => Translator::getInstance()->trans('A short text, used when an additional or supplemental information is required.'),
                    ],
                    'attr' => [
                        'placeholder' => Translator::getInstance()->trans('Short additional text'),
                        'rows'        => 3,
                    ]
                ]
            );
        }
    }