芝麻web文件管理V1.00
编辑当前文件:/home/prismawe/www/itrema/wp-content/plugins/advanced-custom-fields/core/fields/wysiwyg.php
name = 'wysiwyg'; $this->label = __("Wysiwyg Editor",'acf'); $this->category = __("Content",'acf'); $this->defaults = array( 'toolbar' => 'full', 'media_upload' => 'yes', 'default_value' => '', ); // do not delete! parent::__construct(); // filters add_filter( 'acf/fields/wysiwyg/toolbars', array( $this, 'toolbars'), 1, 1 ); } /* * toolbars() * * This filter allowsyou to customize the WYSIWYG toolbars * * @param $toolbars - an array of toolbars * * @return $toolbars - the modified $toolbars * * @type filter * @since 3.6 * @date 23/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; } /* * input_admin_head() * * This action is called in the admin_head action on the edit screen where your field is created. * Use this action to add css and javascript to assist your create_field() action. * * @info http://codex.wordpress.org/Plugin_API/Action_Reference/admin_head * @type action * @since 3.6 * @date 23/01/13 */ function input_admin_head() { add_action( 'admin_footer', array( $this, 'admin_footer') ); } function admin_footer() { ?>
</textarea>
'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'), ) )); ?>
', ']]>', $value); return $value; } } new acf_field_wysiwyg(); ?>