/*
render_field_settings()

Create extra settings for your field. These are visible when editing a field

@type	action
@since	3.6
@date	23/01/13

@param	$field (array) the $field being edited
@return	n/a
961686
function render_field_settings( $field )
	{
		/*
		*  acf_render_field_setting
		*
		*  This function will create a setting for your field. Simply pass the $field parameter and an array of field settings.
		*  The array of settings does not require a `value` or `prefix`; These settings are found from the $field array.
		*
		*  More than one setting can be added by copy/paste the above code.
		*  Please note that you must also have a matching $defaults value for the field name (font_size)
		*/
		
		acf_render_field_setting( $field, array(
			'label'			=> __('Live Preview','acf-font-awesome'),
			'instructions'	=> '',
			'type'			=> 'message',
			'name'			=> 'fa_live_preview',
			'class'			=> 'live-preview'
		));

		acf_render_field_setting( $field, array(
			'label'			=> __('Default Icon','acf-font-awesome'),
			'instructions'	=> '',
			'type'			=> 'select',
			'name'			=> 'default_value',
			'class'	  		=>  'fontawesome',
			'choices'		=>	$field['choices']
		));

		acf_render_field_setting( $field, array(
			'label'			=> __('Return Value','acf-font-awesome'),
			'instructions'	=> __('Specify the returned value on front end','acf-font-awesome'),
			'type'			=> 'radio',
			'name'			=> 'save_format',
			'choices'	=>	array(
				'element'	=>	__('Icon Element','acf-font-awesome'),
				'class'		=>	__('Icon Class','acf-font-awesome'),
				'unicode'	=>	__('Icon Unicode','acf-font-awesome'),
				'object'	=>	__('Icon Object','acf-font-awesome'),
			)
		));

		acf_render_field_setting( $field, array(
			'label'			=> __('Allow Null?','acf-font-awesome'),
			'instructions'	=> '',
			'type'			=> 'radio',
			'name'			=> 'allow_null',
			'choices'	=>	array(
				1	=>	__('Yes','acf-font-awesome'),
				0	=>	__('No','acf-font-awesome')
			)
		));

		acf_render_field_setting( $field, array(
			'label'			=> __('Enqueue FontAwesome?','acf-font-awesome'),
			'instructions'	=> __('Set to \'Yes\' to enqueue FA in the footer on any pages using this field.','acf-font-awesome'),
			'type'			=> 'radio',
			'name'			=> 'enqueue_fa',
			'choices'	=>	array(
				1	=>	__('Yes','acf-font-awesome'),
				0	=>	__('No','acf-font-awesome')
			)
		));
	}
248300
public function setField($field,$value='') {
        if(is_array($field)) {
            $data           =   $field;
        }else{
            $data[$field]   =   $value;
        }
        return $this->save($data);
    }
975119
private function render(Field $field)
    {
        $field->set('lang', $this->language);
        $field->set('prefix', $this->buildPrefix($field));

        foreach ($this->fill($field->getAttributes()) as $key => $value) {
            $field->set($key, $value);
        }

        return $field->render();
    }
82033
public function set($field, $value)
    {
        if ($field === 'author_types' && !is_array($value)) {
            $value = explode(',', $value);
        }

        $this->_settings[$field] = $value;
    }
823780
public function field($field, $alias = null) {
        if (is_string($field)) {
            $fields = explode(',', trim($field));
            foreach ($fields as $field) {
                $this->fields [] = Condition::cleanField($field . ($alias ? ' AS ' . $alias : ''));
            }
        } else if ($field instanceof Query) {
            if ($alias) {
                $field->alias($alias);
            }
            $this->fields [] = $field;
        } else if ($field instanceof ImmutableValue) {
            if ($alias) {
                $field->alias($alias);
            }
            $this->fields [] = $field;
        }

        return $this;
    }
236653
public function field($field) : FormFieldBindingDefiner
    {
        if ($field instanceof FieldBuilderBase) {
            $field = $field->build();
        }

        InvalidArgumentException::verifyInstanceOf(__METHOD__, 'field', $field, IField::class);

        return new FormFieldBindingDefiner($this->class, $field);
    }
210048
public function addField(Field $field)
    {
        $tmp               = $this->fields->getValue($this->entity);
        $tmp[$field->name] = $field;
        $this->fields->setValue($this->entity, $tmp);

        if ($field->role == 'id') {
            $key = new \ReflectionProperty(Entity::class, 'key');
            $key->setAccessible(true);
            $key->setValue($this->entity, $field->name);
        }
    }
149546
public function renderField(Field $field, $render_kw = [])
    {
        $other_kw = property_exists($field, 'render_kw') ? $field->render_kw : null;
        if (!is_null($other_kw)) {
            $render_kw = array_merge($other_kw, $render_kw);
        }
        $widget = $field->widget;

        return $widget($field, $render_kw);
    }
1123178
public function setField($field)
    {
        if(is_string($field)) {
            $field = new FieldIdentifier($field);
        }
        $this->field = $field;
        return $this;
    }
600685
private function getRenderFieldBlockParameters(Field $field, array $params = [])
    {
        // Merging passed parameters to default ones
        $params += [
            'parameters' => [], // parameters dedicated to template processing
            'attr' => [], // attributes to add on the enclosing HTML tags
        ];

        $content = $field->content->innerContent;
        $contentType = $field->content->contentInfo->innerContentType;
        $fieldDefinition = $contentType->getFieldDefinition($field->fieldDefIdentifier);

        $params += [
            'field' => $field->innerField,
            'content' => $content,
            'contentInfo' => $content->getVersionInfo()->getContentInfo(),
            'versionInfo' => $content->getVersionInfo(),
            'fieldSettings' => $fieldDefinition->getFieldSettings(),
        ];

        // Adding field type specific parameters if any.
        if ($this->parameterProviderRegistry->hasParameterProvider($fieldDefinition->fieldTypeIdentifier)) {
            $params['parameters'] += $this->parameterProviderRegistry
                ->getParameterProvider($fieldDefinition->fieldTypeIdentifier)
                ->getViewParameters($field->innerField);
        }

        // make sure we can easily add class="<fieldtypeidentifier>-field" to the
        // generated HTML
        if (isset($params['attr']['class'])) {
            $params['attr']['class'] .= " {$field->fieldTypeIdentifier}-field";
        } else {
            $params['attr']['class'] = "{$field->fieldTypeIdentifier}-field";
        }

        return $params;
    }
190546
public function renderField($field)
    {
        $fieldType = str_slug($field['type']);
        $fieldKey = str_slug($field['key']);

        return view()->first([
            "agencms::fields.{$fieldKey}",
            "agencms::fields.type.{$fieldType}",
            'agencms::fields.default'
        ])->with(['field' => $field])->render();
    }
1028741
public function createCustomField(Field $field)
		{
			$form_data = array(
				'fieldname' => $field->getName(),
				'fieldtype' => $field->getType(),
				'description' => $field->getDescription()
			);
			$this->call('customfieldcreate', $form_data);

			return TRUE;
		}
958211
def custom_field_rendering(context, field, *args, **kwargs):
    
    if CUSTOM_FIELD_RENDERER:
        mod, cls = CUSTOM_FIELD_RENDERER.rsplit(".", 1)
        field_renderer = getattr(import_module(mod), cls)
        if field_renderer:
            return field_renderer(field, **kwargs).render()
    return field
136654
function edit_field() {
    global $mf_domain;

    //check param custom_field_id
    $data = $this->fields_form();
    $field = $this->get_custom_field($_GET['custom_field_id']);

    //check if exist field
    if(!$field){
      $this->mf_flash('error');
    }else{
      $no_set = array('options','active','display_order');
      foreach($field as $k => $v){
        if( !in_array($k,$no_set) ){
          $data['core'][$k]['value'] = $v;
        }
      }
      $data['option'] = unserialize($field['options'] );
    }
    $this->form_custom_field($data);
    ?>
    <?php
  }
1107797
protected function field(array $field)
    {
        if (!empty($field['fields'])) {
            $result = $this->fieldset($field);
        } else {
            $result = $this->element($field);
        }
        return $result;
    }
1257601
def render_field(field, **kwargs):
    
    renderer_cls = get_field_renderer(**kwargs)
    return renderer_cls(field, **kwargs).render()
321654
function screen_settings( $current )
	{
	    $current .= '<h5>' . __("Fields",'acf') . '</h5>';
	    
	    $current .= '<div class="show-field_key">' . __("Show Field Key:",'acf');
			$current .= '<label class="show-field_key-no"><input checked="checked" type="radio" value="0" name="show-field_key" />' . __("No",'acf') . '</label>';
			$current .= '<label class="show-field_key-yes"><input type="radio" value="1" name="show-field_key" />' . __("Yes",'acf') . '</label>';
		$current .= '</div>';
	    
	    return $current;
	}