Plugin Directory

Changeset 1156399


Ignore:
Timestamp:
05/08/2015 06:11:43 PM (11 years ago)
Author:
funkjedi
Message:

Syncing with Github

Location:
acf-qtranslate/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • acf-qtranslate/trunk/readme.txt

    r1155412 r1156399  
    44Requires at least: 3.5.0
    55Tested up to: 4.2.1
    6 Version: 1.7.8
    7 Stable tag: 1.7.8
     6Version: 1.7.9
     7Stable tag: 1.7.9
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5959
    6060== Changelog ==
     61
     62= 1.7.9 =
     63* Bug Fix: WYSIWYG was creating second acf_settings wp_editor instance
    6164
    6265= 1.7.8 =
  • acf-qtranslate/trunk/src/acf_4/fields/wysiwyg.php

    r1155412 r1156399  
    3131
    3232        acf_field::__construct();
    33 
    34         add_filter('acf/fields/wysiwyg/toolbars', array($this, 'toolbars'), 1, 1);
    3533    }
    3634
    3735    /*
    38      *  toolbars()
     36     *  input_admin_head()
    3937     *
    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.
    4140     *
    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
    4743     *  @since  3.6
    4844     *  @date   23/01/13
    4945     */
    50     function toolbars($toolbars) {
    51         return parent::toolbars($toolbars);
    52     }
     46    function input_admin_head() {}
    5347
    5448    /*
     
    6458     */
    6559    function create_field($field) {
    66         $defaults = array(
    67             'toolbar'       =>  'full',
    68             'media_upload'  =>  'yes',
    69         );
    70         $field = array_merge($defaults, $field);
    71 
    72 
    7360        global $q_config, $wp_version;
    7461        $languages = qtrans_getSortedLanguages(true);
     
    8572        foreach ($languages as $language):
    8673            $value = $values[$language];
    87             $id = 'wysiwyg' . $field['id'] . "[$language]";
     74            $id = 'wysiwyg-' . $field['id'] . '-' . uniqid();
    8875            $name = $field['name'] . "[$language]";
    8976            $class = ($language === $currentLanguage) ? 'acf_wysiwyg wp-editor-wrap current-language' : 'acf_wysiwyg wp-editor-wrap';
     
    9178            ?>
    9279            <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' ): ?>
    9481                    <?php if( version_compare($wp_version, '3.3', '<') ): ?>
    9582                        <div id="editor-toolbar">
     
    10794                <?php endif; ?>
    10895                <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>
    110108                </div>
    111109            </div>
Note: See TracChangeset for help on using the changeset viewer.