name = 'wysiwyg'; $this->title = __("Wysiwyg Editor",'acf'); add_action( 'acf_head-input', array( $this, 'acf_head') ); add_filter( 'acf/fields/wysiwyg/toolbars', array( $this, 'toolbars'), 1, 1 ); } /* * get_toolbars * * @description: * @since: 3.5.7 * @created: 10/01/13 */ function toolbars( $toolbars ) { $editor_id = 'acf_settings'; // Full $toolbars['Full'] = array(); $toolbars['Full'][1] = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', 'bullist', 'numlist', 'blockquote', 'justifyleft', 'justifycenter', 'justifyright', 'link', 'unlink', 'wp_more', 'spellchecker', 'fullscreen', 'wp_adv' ), $editor_id); $toolbars['Full'][2] = apply_filters('mce_buttons_2', array( 'formatselect', 'underline', 'justifyfull', 'forecolor', 'pastetext', 'pasteword', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo', 'wp_help', 'code' ), $editor_id); $toolbars['Full'][3] = apply_filters('mce_buttons_3', array(), $editor_id); $toolbars['Full'][4] = apply_filters('mce_buttons_4', array(), $editor_id); // Basic $toolbars['Basic'] = array(); $toolbars['Basic'][1] = apply_filters( 'teeny_mce_buttons', array('bold', 'italic', 'underline', 'blockquote', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'undo', 'redo', 'link', 'unlink', 'fullscreen'), $editor_id ); // Custom - can be added with acf/fields/wysiwyg/toolbars filter return $toolbars; } /*-------------------------------------------------------------------------------------- * * admin_head * - Add the settings for a WYSIWYG editor (as used in wp_editor / wp_tiny_mce) * * @author Elliot Condon * @since 3.2.3 * *-------------------------------------------------------------------------------------*/ function acf_head() { add_action( 'admin_footer', array( $this, 'admin_footer') ); } function admin_footer() { ?>
'full', 'media_upload' => 'yes', 'the_content' => 'yes', 'default_value' => '', ); $field = array_merge($defaults, $field); ?> 'textarea', 'name' => 'fields['.$key.'][default_value]', 'value' => $field['default_value'], )); ?> $v ) { $label = $k; $name = sanitize_title( $label ); $name = str_replace('-', '_', $name); $choices[ $name ] = $label; } } do_action('acf/create_field', array( 'type' => 'radio', 'name' => 'fields['.$key.'][toolbar]', 'value' => $field['toolbar'], 'layout' => 'horizontal', 'choices' => $choices )); ?> 'radio', 'name' => 'fields['.$key.'][media_upload]', 'value' => $field['media_upload'], 'layout' => 'horizontal', 'choices' => array( 'yes' => __("Yes",'acf'), 'no' => __("No",'acf'), ) )); ?>

'radio', 'name' => 'fields['.$key.'][the_content]', 'value' => $field['the_content'], 'layout' => 'horizontal', 'choices' => array( 'yes' => __("Yes",'acf'), 'no' => __("No",'acf'), ) )); ?> 'full', 'media_upload' => 'yes', ); $field = array_merge($defaults, $field); $id = 'wysiwyg-' . $field['id']; ?>
'yes', ); $field = array_merge($defaults, $field); $value = parent::get_value($post_id, $field); // filter if( $field['the_content'] == 'yes' ) { $value = apply_filters('the_content',$value); } else { $value = wpautop( $value ); } return $value; } } ?>