Plugin Directory

Changeset 2031477


Ignore:
Timestamp:
02/15/2019 02:21:52 PM (7 years ago)
Author:
aprokopenko
Message:

v3.3.1 Shortcodes fix, gutenberg patch

Location:
just-custom-fields
Files:
159 added
5 edited

Legend:

Unmodified
Added
Removed
  • just-custom-fields/trunk/components/simplemedia/JustField_SimpleMedia.php

    r1646707 r2031477  
    177177    {
    178178        if ( empty($this->entry) ) return '';
    179 
    180         $size = isset($args['size'])? $args['size'] : 'thumbnail';
    181         $value = wp_get_attachment_image($this->entry, $size);
     179       
     180        $imagesizes = wp_get_attachment_image_sizes($this->entry);
     181        if ( !empty($imagesizes) ) {
     182            // assume this is an image.
     183            $size = isset($args['size'])? $args['size'] : 'thumbnail';
     184            $value = wp_get_attachment_image($this->entry, $size);
     185        } else {
     186            // generate a file link.
     187            $link = wp_get_attachment_url($this->entry);
     188            $value = "<a href=\"{$link}\" target=\"_blank\">" . basename($link) . "</a>";
     189        }
    182190
    183191        return $args['before_value'] . $value . $args['after_value'];
     
    185193
    186194}
    187 ?>
  • just-custom-fields/trunk/components/textarea/JustField_Textarea.php

    r1646707 r2031477  
    1313class JustField_Textarea extends core\JustField
    1414{
    15 
    1615    public function __construct()
    1716    {
     
    2625    public function field()
    2726    {
     27        $adv_buttons = 'bold,italic,strikethrough,|,bullist,numlist,blockquote,|,justifyleft,justifycenter,justifyright,|,link,unlink,|,spellchecker,fullscreen,wp_adv';
    2828        ?>
    2929        <div id="jcf_field-<?php echo $this->id; ?>" class="jcf_edit_field <?php echo $this->fieldOptions['classname']; ?>">
     
    3131                <?php echo $this->fieldOptions['before_title'] . esc_html($this->instance['title']) . $this->fieldOptions['after_title']; ?>
    3232                <?php
    33                 if ( !empty($this->instance['editor']) ) : // check editor
    34 
     33                // In v5 with gutenberg editor is not working inside the collection.
     34                global $wp_version;
     35                if ( !empty($this->instance['editor'])
     36                    && !($this->collectionId && 5 <= (int)$GLOBALS['wp_version'])
     37                    ) : // check editor
    3538                    ob_start();
    3639                    /**
     
    4548                        'quicktags' => false,
    4649                        'tinymce' => array(
    47                             'theme_advanced_buttons1' => 'bold,italic,strikethrough,|,bullist,numlist,blockquote,|,justifyleft,justifycenter,justifyright,|,link,unlink,|,spellchecker,fullscreen,wp_adv',
     50                            'theme_advanced_buttons1' => $adv_buttons,
    4851                        ),
    4952                    ));
  • just-custom-fields/trunk/just-custom-fields.php

    r1646707 r2031477  
    77Author: JustCoded / Alex Prokopenko
    88Author URI: http://justcoded.com/
    9 Version: 3.3
     9Version: 3.3.1
    1010*/
    1111define('JCF_ROOT', dirname(__FILE__));
     
    2323     */
    2424    const TEXTDOMAIN = 'just-custom-fields';
    25     const VERSION = '3.300';
     25    const VERSION = '3.301';
    2626
    2727    /**
  • just-custom-fields/trunk/readme.txt

    r1996488 r2031477  
    77Author URI: http://justcoded.com/
    88Requires at least: 4.7
    9 Tested up to: 5.0.1
     9Tested up to: 5.0.3
    1010Stable tag: trunk
    1111License: GNU General Public License v2
     
    8585
    8686== Changelog ==
     87* Version 3.3.1 - 15 February 2019
     88    * Bug: Simplemedia shortcode do not display a link if it's not an image.
     89    * Hotfix: Disabled Textarea editors inside collections for WordPress 5+, because tinyMCE is not working there.
     90    * Note: Added a note that visibility rules are not working with a Gutenberg plugin.
    8791* Version 3.3 - 26 April 2017
    8892    * New feature: Taxonomy term custom fields!
  • just-custom-fields/trunk/views/fieldsets/form.php

    r1646707 r2031477  
    5353                            </h4>
    5454                            <div id="visibility" class="<?php echo !empty($fieldset['visibility_rules']) ? '' : 'hidden' ?>">
     55                                <em>* Visibility rules don't work with a new Gutenberg editor.</em>
    5556                                <?php if( !empty($fieldset['visibility_rules']) ): ?>
    5657                                    <?php $this->_render('fieldsets/visibility/rules', array(
Note: See TracChangeset for help on using the changeset viewer.