WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Авторские Темы для WordPress
функция не описана

acf_field_image::render_field_settings() public ACF 3.6

Create extra options for your field. This is rendered when editing a field. The value of $field['name'] can be used (like bellow) to save extra data to the $field

{} Это метод класса: acf_field_image{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$acf_field_image = new acf_field_image();
$acf_field_image->render_field_settings( $field );
$field (обязательный)
-

Список изменений

С версии 3.6 Введена.

Код acf_field_image::render_field_settings() ACF 5.9.1

<?php
function render_field_settings( $field ) {
	
	// clear numeric settings
	$clear = array(
		'min_width',
		'min_height',
		'min_size',
		'max_width',
		'max_height',
		'max_size'
	);
	
	foreach( $clear as $k ) {
		
		if( empty($field[$k]) ) {
			
			$field[$k] = '';
			
		}
		
	}
	
	
	// return_format
	acf_render_field_setting( $field, array(
		'label'			=> __('Return Format','acf'),
		'instructions'	=> '',
		'type'			=> 'radio',
		'name'			=> 'return_format',
		'layout'		=> 'horizontal',
		'choices'		=> array(
			'array'			=> __("Image Array",'acf'),
			'url'			=> __("Image URL",'acf'),
			'id'			=> __("Image ID",'acf')
		)
	));
	
	
	// preview_size
	acf_render_field_setting( $field, array(
		'label'			=> __('Preview Size','acf'),
		'instructions'	=> '',
		'type'			=> 'select',
		'name'			=> 'preview_size',
		'choices'		=> acf_get_image_sizes()
	));
	
	
	// library
	acf_render_field_setting( $field, array(
		'label'			=> __('Library','acf'),
		'instructions'	=> __('Limit the media library choice','acf'),
		'type'			=> 'radio',
		'name'			=> 'library',
		'layout'		=> 'horizontal',
		'choices' 		=> array(
			'all'			=> __('All', 'acf'),
			'uploadedTo'	=> __('Uploaded to post', 'acf')
		)
	));
	
	
	// min
	acf_render_field_setting( $field, array(
		'label'			=> __('Minimum','acf'),
		'instructions'	=> __('Restrict which images can be uploaded','acf'),
		'type'			=> 'text',
		'name'			=> 'min_width',
		'prepend'		=> __('Width', 'acf'),
		'append'		=> 'px',
	));
	
	acf_render_field_setting( $field, array(
		'label'			=> '',
		'type'			=> 'text',
		'name'			=> 'min_height',
		'prepend'		=> __('Height', 'acf'),
		'append'		=> 'px',
		'_append' 		=> 'min_width'
	));
	
	acf_render_field_setting( $field, array(
		'label'			=> '',
		'type'			=> 'text',
		'name'			=> 'min_size',
		'prepend'		=> __('File size', 'acf'),
		'append'		=> 'MB',
		'_append' 		=> 'min_width'
	));	
	
	
	// max
	acf_render_field_setting( $field, array(
		'label'			=> __('Maximum','acf'),
		'instructions'	=> __('Restrict which images can be uploaded','acf'),
		'type'			=> 'text',
		'name'			=> 'max_width',
		'prepend'		=> __('Width', 'acf'),
		'append'		=> 'px',
	));
	
	acf_render_field_setting( $field, array(
		'label'			=> '',
		'type'			=> 'text',
		'name'			=> 'max_height',
		'prepend'		=> __('Height', 'acf'),
		'append'		=> 'px',
		'_append' 		=> 'max_width'
	));
	
	acf_render_field_setting( $field, array(
		'label'			=> '',
		'type'			=> 'text',
		'name'			=> 'max_size',
		'prepend'		=> __('File size', 'acf'),
		'append'		=> 'MB',
		'_append' 		=> 'max_width'
	));	
	
	
	// allowed type
	acf_render_field_setting( $field, array(
		'label'			=> __('Allowed file types','acf'),
		'instructions'	=> __('Comma separated list. Leave blank for all types','acf'),
		'type'			=> 'text',
		'name'			=> 'mime_types',
	));
	
}