Create a hidden field

@param   string|array  either fieldname or full attributes array (when array other params are ignored)
@param   string
@param   array
@return  string
967586
public function hidden($field, $value = null, array $attributes = array())
	{
		if (is_array($field))
		{
			$attributes = $field;
		}
		else
		{
			$attributes['name'] = (string) $field;
			$attributes['value'] = (string) $value;
		}
		$attributes['type'] = 'hidden';

		return $this->input($attributes);
	}
510845
function create_field( $field )
	{
		if( 'object' == $field['save_format'] && 'null' !== $field['value'] )
			$field['value'] = array( $field['value']->class );

		// value must be array
		if( !is_array($field['value']) )
		{
			// perhaps this is a default value with new lines in it?
			if( strpos($field['value'], "\n") !== false )
			{
				// found multiple lines, explode it
				$field['value'] = explode("\n", $field['value']);
			}
			else
			{
				$field['value'] = array( $field['value'] );
			}
		}
		
		// trim value
		$field['value'] = array_map('trim', $field['value']);
		
		// html
		echo '<div class="fa-field-wrapper">';
		echo '<div class="fa-live-preview"></div>';
		echo '<select id="' . $field['id'] . '" class="' . $field['class'] . ' fa-select2-field" name="' . $field['name'] . '" >';	
		
		// null
		if( $field['allow_null'] )
		{
			echo '<option value="null">- ' . __("Select",'acf') . ' -</option>';
		}
		
		// loop through values and add them as options
		if( is_array($field['choices']) )
		{
			unset( $field['choices']['null'] );

			foreach( $field['choices'] as $key => $value )
			{
				$selected = $this->find_selected( $key, $field['value'], $field['save_format'], $field['choices'] );
				echo '<option value="'.$key.'" '.$selected.'>'.$value.'</option>';
			}
		}

		echo '</select>';
		echo '</div>';
	}
260228
public function hidden($name = null, $value = null, $attr = null)
    {
        return $this->createInput('hidden', $name, $value, $attr);
    }
211436
public function fliterFields($fields = null){

        if (is_string($fields)){ // Comma Seperated List (eg Url Param)
            $fields = explode(',', $fields);
        }

        if(empty($fields)){
            $this->hidden = [];
        } else {
            $this->hidden = ['id','parent_id','left','right','depth','name','alternames','country','level','population','lat','long'];
            foreach ($fields as $field) {
                $index = array_search($field, $this->hidden);
                if($index !== false){
                    unset($this->hidden[$index]);
                }
            };
            $this->hidden = array_values($this->hidden);
        }

        return $this;
    }
422348
private static void createTokenHiddenField(Controller controller, String tokenName, String tokenId) {
		StringBuilder sb = new StringBuilder();
		sb.append("<input type='hidden' name='").append(tokenName).append("' id='").append(tokenName).append("' value='").append(tokenId).append("' />");
		controller.setAttr("token", sb.toString());
	}
1180944
public function isHidden($column)
    {
        $attributes = $this->config('hidden', []);

        if (! is_array($attributes)) {
            throw new \RuntimeException('Config field [hidden] must be an array of attributes to hide from array or json.');
        }

        foreach ($attributes as $pattern) {
            if (Str::is($pattern, $column)) {
                return true;
            }
        }

        return false;
    }
1361779
function create_field( $field )
	{
		// vars
		$optgroup = false;
		
		
		// determin if choices are grouped (2 levels of array)
		if( is_array($field['choices']) )
		{
			foreach( $field['choices'] as $k => $v )
			{
				if( is_array($v) )
				{
					$optgroup = true;
				}
			}
		}
		
		
		// value must be array
		if( !is_array($field['value']) )
		{
			// perhaps this is a default value with new lines in it?
			if( strpos($field['value'], "\n") !== false )
			{
				// found multiple lines, explode it
				$field['value'] = explode("\n", $field['value']);
			}
			else
			{
				$field['value'] = array( $field['value'] );
			}
		}
		
		
		// trim value
		$field['value'] = array_map('trim', $field['value']);
		
		
		// multiple select
		$multiple = '';
		if( $field['multiple'] )
		{
			// create a hidden field to allow for no selections
			echo '<input type="hidden" name="' . $field['name'] . '" />';
			
			$multiple = ' multiple="multiple" size="5" ';
			$field['name'] .= '[]';
		} 
		
		
		// html
		echo '<select id="' . $field['id'] . '" class="' . $field['class'] . '" name="' . $field['name'] . '" ' . $multiple . ' >';	
		
		
		// null
		if( $field['allow_null'] )
		{
			echo '<option value="null">- ' . __("Select",'acf') . ' -</option>';
		}
		
		// loop through values and add them as options
		if( is_array($field['choices']) )
		{
			foreach( $field['choices'] as $key => $value )
			{
				if( $optgroup )
				{
					// this select is grouped with optgroup
					if($key != '') echo '<optgroup label="'.$key.'">';
					
					if( is_array($value) )
					{
						foreach($value as $id => $label)
						{
							$selected = in_array($id, $field['value']) ? 'selected="selected"' : '';
														
							echo '<option value="'.$id.'" '.$selected.'>'.$label.'</option>';
						}
					}
					
					if($key != '') echo '</optgroup>';
				}
				else
				{
					$selected = in_array($key, $field['value']) ? 'selected="selected"' : '';
					echo '<option value="'.$key.'" '.$selected.'>'.$value.'</option>';
				}
			}
		}

		echo '</select>';
	}
927889
function create_field( $field )
	{
		// global
		global $post;

		
		// no row limit?
		if( !$field['max'] || $field['max'] < 1 )
		{
			$field['max'] = 9999;
		}
		
		
		// class
		$class = '';
		if( $field['filters'] )
		{
			foreach( $field['filters'] as $filter )
			{
				$class .= ' has-' . $filter;
			}
		}
		
		$attributes = array(
			'max' => $field['max'],
			's' => '',
			'paged' => 1,
			'post_type' => implode(',', $field['post_type']),
			'taxonomy' => implode(',', $field['taxonomy']),
			'field_key' => $field['key']
		);
		
		
		// Lang
		if( defined('ICL_LANGUAGE_CODE') )
		{
			$attributes['lang'] = ICL_LANGUAGE_CODE;
		}
		
		
		// parent
		preg_match('/\[(field_.*?)\]/', $field['name'], $ancestor);
		if( isset($ancestor[1]) && $ancestor[1] != $field['key'])
		{
			$attributes['ancestor'] = $ancestor[1];
		}
				
		?>
<div class="acf_relationship<?php echo $class; ?>"<?php foreach( $attributes as $k => $v ): ?> data-<?php echo $k; ?>="<?php echo $v; ?>"<?php endforeach; ?>>
	
	
	<!-- Hidden Blank default value -->
	<input type="hidden" name="<?php echo $field['name']; ?>" value="" />
	
	
	<!-- Left List -->
	<div class="relationship_left">
		<table class="widefat">
			<thead>
				<?php if(in_array( 'search', $field['filters']) ): ?>
				<tr>
					<th>
						<input class="relationship_search" placeholder="<?php _e("Search...",'acf'); ?>" type="text" id="relationship_<?php echo $field['name']; ?>" />
					</th>
				</tr>
				<?php endif; ?>
				<?php if(in_array( 'post_type', $field['filters']) ): ?>
				<tr>
					<th>
						<?php 
						
						// vars
						$choices = array(
							'all' => __("Filter by post type",'acf')
						);
						
						
						if( in_array('all', $field['post_type']) )
						{
							$post_types = apply_filters( 'acf/get_post_types', array() );
							$choices = array_merge( $choices, $post_types);
						}
						else
						{
							foreach( $field['post_type'] as $post_type )
							{
								$choices[ $post_type ] = $post_type;
							}
						}
						
						
						// create field
						do_action('acf/create_field', array(
							'type'	=>	'select',
							'name'	=>	'',
							'class'	=>	'select-post_type',
							'value'	=>	'',
							'choices' => $choices,
						));
						
						?>
					</th>
				</tr>
				<?php endif; ?>
			</thead>
		</table>
		<ul class="bl relationship_list">
			<li class="load-more">
				<div class="acf-loading"></div>
			</li>
		</ul>
	</div>
	<!-- /Left List -->
	
	<!-- Right List -->
	<div class="relationship_right">
		<ul class="bl relationship_list">
		<?php

		if( $field['value'] )
		{
			foreach( $field['value'] as $p )
			{
				$title = $this->get_result($p, $field, $post);
				
				
				echo '<li>
					<a href="' . get_permalink($p->ID) . '" class="" data-post_id="' . $p->ID . '">' . $title . '<span class="acf-button-remove"></span></a>
					<input type="hidden" name="' . $field['name'] . '[]" value="' . $p->ID . '" />
				</li>';
				
					
			}
		}
			
		?>
		</ul>
	</div>
	<!-- / Right List -->
	
</div>
		<?php
	}
926108
public function hiddenFormFields()
    {
        $fields = $this->getParameter('fields');

        if (empty($fields))
            return '';

        $html_array = ArrayUtils::htmlArrayFlatten($fields);

        foreach ($html_array as $name => $value) {
            $name  = htmlentities($name, ENT_QUOTES);
            $value = htmlentities($value, ENT_QUOTES);

            $output[] = "<input type=\"hidden\" name=\"$name\" value=\"$value\" />";
        }

        return join("\n", $output);
    }
966627
public function hidden($name, $callback = null)
    {
        $value = data_get($this->row, $name);

        $field = new Fluent([
            'name'       => $name,
            'value'      => $value ?: '',
            'attributes' => [],
        ]);

        if ($callback instanceof Closure) {
            call_user_func($callback, $field);
        }

        $this->hiddens[$name] = $this->app->make('form')->hidden($name, $field->get('value'), $field->get('attributes'));
    }
98916
public function form_tag($attrib, $content = null)
    {
        if ($this->env['extwin']) {
            $hiddenfield = new html_hiddenfield(array('name' => '_extwin', 'value' => '1'));
            $hidden = $hiddenfield->show();
        }
        else if ($this->framed || $this->env['framed']) {
            $hiddenfield = new html_hiddenfield(array('name' => '_framed', 'value' => '1'));
            $hidden = $hiddenfield->show();
        }

        if (!$content) {
            $attrib['noclose'] = true;
        }

        return html::tag('form',
            $attrib + array('action' => $this->app->comm_path, 'method' => "get"),
            $hidden . $content,
            array('id','class','style','name','method','action','enctype','onsubmit')
        );
    }
316292
public function form_hidden($params) {
        if (!isset($params['field'])) {
            throw new \UnexpectedValueException("The field parameter is required.");
        }
        $value = isset($params['value']) ? $params['value'] : null;
        $attributes = isset($params['attrs']) ? $params['attrs'] : array();
        return Form::hidden($params['field'], $value, $attributes);
    }
1251486
public function input($field, $value = null, array $attributes = array())
	{
		if (is_array($field))
		{
			$attributes = $field;
			! array_key_exists('value', $attributes) and $attributes['value'] = '';
		}
		else
		{
			$attributes['name'] = (string) $field;
			$attributes['value'] = (string) $value;
		}

		$attributes['type'] = empty($attributes['type']) ? 'text' : $attributes['type'];

		if ( ! in_array($attributes['type'], static::$_valid_inputs))
		{
			throw new \InvalidArgumentException(sprintf('"%s" is not a valid input type.', $attributes['type']));
		}

		if ($this->get_config('prep_value', true) && empty($attributes['dont_prep']))
		{
			$attributes['value'] = $this->prep_value($attributes['value']);
		}
		unset($attributes['dont_prep']);

		if (empty($attributes['id']) && $this->get_config('auto_id', false) == true)
		{
			$attributes['id'] = $this->get_config('auto_id_prefix', 'form_').$attributes['name'];
		}

		$tag = ! empty($attributes['tag']) ? $attributes['tag'] : 'input';
		unset($attributes['tag']);

		return html_tag($tag, $this->attr_to_string($attributes));
	}
293371
function create_field( $field )
	{
		// vars
		$o = array(
			'class'		=>	'',
			'icon'		=>	'',
			'title'		=>	'',
			'size'		=>	'',
			'url'		=>	'',
			'name'		=>	'',
		);
		
		if( $field['value'] && is_numeric($field['value']) )
		{
			$file = get_post( $field['value'] );
			
			if( $file )
			{
				$o['class'] = 'active';
				$o['icon'] = wp_mime_type_icon( $file->ID );
				$o['title']	= $file->post_title;
				$o['size'] = size_format(filesize( get_attached_file( $file->ID ) ));
				$o['url'] = wp_get_attachment_url( $file->ID );
				
				$explode = explode('/', $o['url']);
				$o['name'] = end( $explode );				
			}
		}
		
		
		?>
<div class="acf-file-uploader clearfix <?php echo $o['class']; ?>" data-library="<?php echo $field['library']; ?>">
	<input class="acf-file-value" type="hidden" name="<?php echo $field['name']; ?>" value="<?php echo $field['value']; ?>" />
	<div class="has-file">
		<ul class="hl clearfix">
			<li>
				<img class="acf-file-icon" src="<?php echo $o['icon']; ?>" alt=""/>
				<div class="hover">
					<ul class="bl">
						<li><a href="#" class="acf-button-delete ir">Remove</a></li>
						<li><a href="#" class="acf-button-edit ir">Edit</a></li>
					</ul>
				</div>
			</li>
			<li>
				<p>
					<strong class="acf-file-title"><?php echo $o['title']; ?></strong>
				</p>
				<p>
					<strong><?php _e('Name', 'acf'); ?>:</strong>
					<a class="acf-file-name" href="<?php echo $o['url']; ?>" target="_blank"><?php echo $o['name']; ?></a>
				</p>
				<p>
					<strong><?php _e('Size', 'acf'); ?>:</strong>
					<span class="acf-file-size"><?php echo $o['size']; ?></span>
				</p>
				
			</li>
		</ul>
	</div>
	<div class="no-file">
		<ul class="hl clearfix">
			<li>
				<span><?php _e('No File Selected','acf'); ?></span>. <a href="#" class="button add-file"><?php _e('Add File','acf'); ?></a>
			</li>
		</ul>
	</div>
</div>
		<?php
	}
999935
protected function hideParameters($data, $hidden)
    {
        foreach ($hidden as $parameter) {
            if (Arr::get($data, $parameter)) {
                Arr::set($data, $parameter, '********');
            }
        }

        return $data;
    }
1263745
public static function getHiddenField(string $name = null): string
    {
        $name = $name ?: self::$currentName;

        return sprintf('<input type="text" name="%s" style="display: none">', $name);
    }
177009
public static function hidden($field, $value = null, array $attributes = array())
	{
		return static::$instance->hidden($field, $value, $attributes);
	}