Changeset 1156399
- Timestamp:
- 05/08/2015 06:11:43 PM (11 years ago)
- Location:
- acf-qtranslate/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
src/acf_4/fields/wysiwyg.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
acf-qtranslate/trunk/readme.txt
r1155412 r1156399 4 4 Requires at least: 3.5.0 5 5 Tested up to: 4.2.1 6 Version: 1.7. 87 Stable tag: 1.7. 86 Version: 1.7.9 7 Stable tag: 1.7.9 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 59 59 60 60 == Changelog == 61 62 = 1.7.9 = 63 * Bug Fix: WYSIWYG was creating second acf_settings wp_editor instance 61 64 62 65 = 1.7.8 = -
acf-qtranslate/trunk/src/acf_4/fields/wysiwyg.php
r1155412 r1156399 31 31 32 32 acf_field::__construct(); 33 34 add_filter('acf/fields/wysiwyg/toolbars', array($this, 'toolbars'), 1, 1);35 33 } 36 34 37 35 /* 38 * toolbars()36 * input_admin_head() 39 37 * 40 * This filter allowsyou to customize the WYSIWYG toolbars 38 * This action is called in the admin_head action on the edit screen where your field is created. 39 * Use this action to add css and javascript to assist your create_field() action. 41 40 * 42 * @param $toolbars - an array of toolbars 43 * 44 * @return $toolbars - the modified $toolbars 45 * 46 * @type filter 41 * @info http://codex.wordpress.org/Plugin_API/Action_Reference/admin_head 42 * @type action 47 43 * @since 3.6 48 44 * @date 23/01/13 49 45 */ 50 function toolbars($toolbars) { 51 return parent::toolbars($toolbars); 52 } 46 function input_admin_head() {} 53 47 54 48 /* … … 64 58 */ 65 59 function create_field($field) { 66 $defaults = array(67 'toolbar' => 'full',68 'media_upload' => 'yes',69 );70 $field = array_merge($defaults, $field);71 72 73 60 global $q_config, $wp_version; 74 61 $languages = qtrans_getSortedLanguages(true); … … 85 72 foreach ($languages as $language): 86 73 $value = $values[$language]; 87 $id = 'wysiwyg ' . $field['id'] . "[$language]";74 $id = 'wysiwyg-' . $field['id'] . '-' . uniqid(); 88 75 $name = $field['name'] . "[$language]"; 89 76 $class = ($language === $currentLanguage) ? 'acf_wysiwyg wp-editor-wrap current-language' : 'acf_wysiwyg wp-editor-wrap'; … … 91 78 ?> 92 79 <div id="wp-<?php echo $id; ?>-wrap" class="<?php echo $class; ?>" data-toolbar="<?php echo $field['toolbar']; ?>" data-upload="<?php echo $field['media_upload']; ?>" data-language="<?php echo $language; ?>"> 93 <?php if( $field['media_upload'] == 'yes'): ?>80 <?php if( user_can_richedit() && $field['media_upload'] == 'yes' ): ?> 94 81 <?php if( version_compare($wp_version, '3.3', '<') ): ?> 95 82 <div id="editor-toolbar"> … … 107 94 <?php endif; ?> 108 95 <div id="wp-<?php echo $id; ?>-editor-container" class="wp-editor-container"> 109 <textarea id="<?php echo $id; ?>" class="qtx-wp-editor-area" name="<?php echo $name; ?>" ><?php echo wp_richedit_pre($value); ?></textarea> 96 <textarea id="<?php echo $id; ?>" class="qtx-wp-editor-area" name="<?php echo $name; ?>" ><?php 97 98 if( user_can_richedit() ) 99 { 100 echo wp_richedit_pre( $field['value'] ); 101 } 102 else 103 { 104 echo wp_htmledit_pre( $field['value'] ); 105 } 106 107 ?></textarea> 110 108 </div> 111 109 </div>
Note: See TracChangeset
for help on using the changeset viewer.