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

acf_field_wysiwyg::render_field() public ACF 1.0

*

*  Create the HTML interface for your field
*
*  @param   $field - an array holding all the field's data
*

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

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

Хуки из метода
Возвращает

Null. Ничего.

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

$acf_field_wysiwyg = new acf_field_wysiwyg();
$acf_field_wysiwyg->render_field( $field );

Код acf_field_wysiwyg::render_field() ACF 5.9.1

<?php
function render_field( $field ) {
	
	// enqueue
	acf_enqueue_uploader();
	
	
	// vars
	$id = uniqid('acf-editor-');
	$default_editor = 'html';
	$show_tabs = true;
	$button = '';
	
	
	// get height
	$height = acf_get_user_setting('wysiwyg_height', 300);
	$height = max( $height, 300 ); // minimum height is 300
	
	
	// detect mode
	if( !user_can_richedit() ) {
		
		$show_tabs = false;
		
	} elseif( $field['tabs'] == 'visual' ) {
		
		// case: visual tab only
		$default_editor = 'tinymce';
		$show_tabs = false;
		
	} elseif( $field['tabs'] == 'text' ) {
		
		// case: text tab only
		$show_tabs = false;
		
	} elseif( wp_default_editor() == 'tinymce' ) {
		
		// case: both tabs
		$default_editor = 'tinymce';
		
	}
	
	
	// must be logged in tp upload
	if( !current_user_can('upload_files') ) {
		
		$field['media_upload'] = 0;
		
	}
	
	
	// mode
	$switch_class = ($default_editor === 'html') ? 'html-active' : 'tmce-active';
	
	
	// filter value for editor
	remove_filter( 'acf_the_editor_content', 'format_for_editor', 10, 2 );
	remove_filter( 'acf_the_editor_content', 'wp_htmledit_pre', 10, 1 );
	remove_filter( 'acf_the_editor_content', 'wp_richedit_pre', 10, 1 );
	
	
	// WP 4.3
	if( acf_version_compare('wp', '>=', '4.3') ) {
		
		add_filter( 'acf_the_editor_content', 'format_for_editor', 10, 2 );
		
		$button = 'data-wp-editor-id="' . $id . '"';
		
	// WP < 4.3
	} else {
		
		$function = ($default_editor === 'html') ? 'wp_htmledit_pre' : 'wp_richedit_pre';
		
		add_filter('acf_the_editor_content', $function, 10, 1);
		
		$button = 'onclick="switchEditors.switchto(this);"';
		
	}
	
	
	// filter
	$field['value'] = apply_filters( 'acf_the_editor_content', $field['value'], $default_editor );
	
	
	// attr
	$wrap = array(
		'id'			=> 'wp-' . $id . '-wrap',
		'class'			=> 'acf-editor-wrap wp-core-ui wp-editor-wrap ' . $switch_class,
		'data-toolbar'	=> $field['toolbar']
	);
	
	
	// delay
	if( $field['delay'] ) {
		$wrap['class'] .= ' delay';
	}
	
	
	// vars
	$textarea = acf_get_textarea_input(array(
		'id'	=> $id,
		'class'	=> 'wp-editor-area',
		'name'	=> $field['name'],
		'style'	=> $height ? "height:{$height}px;" : '',
		'value'	=> '%s'
	));
	
	?>
	<div <?php acf_esc_attr_e($wrap); ?>>
		<div id="wp-<?php echo $id; ?>-editor-tools" class="wp-editor-tools hide-if-no-js">
			<?php if( $field['media_upload'] ): ?>
			<div id="wp-<?php echo $id; ?>-media-buttons" class="wp-media-buttons">
				<?php 
				if( !function_exists( 'media_buttons' ) ) {
					require ABSPATH . 'wp-admin/includes/media.php';
				}
				do_action( 'media_buttons', $id ); 
				?>
			</div>
			<?php endif; ?>
			<?php if( user_can_richedit() && $show_tabs ): ?>
				<div class="wp-editor-tabs">
					<button id="<?php echo $id; ?>-tmce" class="wp-switch-editor switch-tmce" <?php echo $button; ?> type="button"><?php echo __('Visual', 'acf'); ?></button>
					<button id="<?php echo $id; ?>-html" class="wp-switch-editor switch-html" <?php echo $button; ?> type="button"><?php echo _x( 'Text', 'Name for the Text editor tab (formerly HTML)', 'acf' ); ?></button>
				</div>
			<?php endif; ?>
		</div>
		<div id="wp-<?php echo $id; ?>-editor-container" class="wp-editor-container">
			<?php if( $field['delay'] ): ?>
				<div class="acf-editor-toolbar"><?php _e('Click to initialize TinyMCE', 'acf'); ?></div>
			<?php endif; ?>
			<?php printf( $textarea, $field['value'] ); ?>
		</div>
	</div>
	<?php
			
}