Plugin Directory

Changeset 1694125


Ignore:
Timestamp:
07/11/2017 03:21:10 AM (9 years ago)
Author:
kopatheme
Message:

Release version 2.0.8

Location:
kopa-page-builder
Files:
67 added
4 edited

Legend:

Unmodified
Added
Removed
  • kopa-page-builder/trunk/inc/class-kpb-widget.php

    r1509143 r1694125  
    151151
    152152                            $widgets = $block_info['items'];
    153 
     153                            unset($widgets['WP_Widget_Media_Video']);
     154                            unset($widgets['WP_Widget_Media_Image']);
     155                            unset($widgets['WP_Widget_Media_Audio']);
    154156                            ksort( $widgets );
    155157
     
    244246                                <?php
    245247                                $widgets = $block_info['items'];
     248                                unset($widgets['WP_Widget_Media_Video']);
     249                                unset($widgets['WP_Widget_Media_Image']);
     250                                unset($widgets['WP_Widget_Media_Audio']);
    246251                                ksort( $widgets );
    247252                                foreach ( $widgets as $class_name => $widget_info ) :
     
    462467           
    463468                            <div id="<?php echo "kpb-tab-widget-{$widget->id_base}"; ?>" class="kpb-tab-content">
    464                                 <?php $widget->form( $instance ); ?>
     469                                <?php
     470                                    if ( $class_name == 'WP_Widget_Text' ) {
     471                                        $this->form_wg_text( $instance );
     472                                    } else {
     473                                        $widget->form( $instance );
     474                                    }
     475                                ?>
    465476                            </div>
    466477
     
    556567            // Create instance of current widget.
    557568            $obj              = new $widget['class_name'];
    558             $widget['widget'] = $obj->update( $widget['widget'], array() );
     569
     570            if ( $widget['class_name'] == 'WP_Widget_Text' ) {
     571                $this->update_wg_text( $widget['widget'], array() );
     572            } else {
     573                $widget['widget'] = $obj->update( $widget['widget'], array() );
     574            }
    559575           
    560576            // Create title for visual block.
     
    611627
    612628            ob_start();
    613             $obj->form( $widget['widget'] );
     629            if ( $widget['class_name'] == 'WP_Widget_Text' ) {
     630                $this->form_wg_text( $widget['widget'] );
     631            } else {
     632                $obj->form( $widget['widget'] );
     633            }
     634
     635
    614636            $response['form'] = $html_minifier->minify( stripslashes( ob_get_clean() ) );
    615637
     
    620642            exit();
    621643        }
     644
     645        public function form_wg_text( $instance ) {
     646            $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'text' => '' ) );
     647            $filter = isset( $instance['filter'] ) ? $instance['filter'] : 0;
     648            $title = sanitize_text_field( $instance['title'] );
     649            ?>
     650            <p><label for="widget-kpb-0-title"><?php _e('Title:'); ?></label>
     651            <input class="widefat" id="widget-kpb-0-title" name="widget-kpb[0][title]" type="text" value="<?php echo esc_attr($title); ?>" /></p>
     652
     653            <p><label for="widget-kpb-0-text"><?php _e( 'Content:' ); ?></label>
     654            <textarea class="widefat" rows="16" cols="20" id="widget-kpb-0-text" name="widget-kpb[0][text]"><?php echo esc_textarea( $instance['text'] ); ?></textarea></p>
     655
     656            <p><input id="widget-kpb-0-filter" name="widget-kpb[0][filter]" type="checkbox"<?php if ( 'on' === $filter ) echo 'checked="checked"'; ?> />&nbsp;<label for="widget-kpb-0-filter"><?php _e('Automatically add paragraphs'); ?></label></p>
     657            <?php
     658        }
     659
     660        public function update_wg_text( $new_instance, $old_instance ) {
     661            $instance = $old_instance;
     662            $instance['title'] = sanitize_text_field( $new_instance['title'] );
     663            if ( current_user_can( 'unfiltered_html' ) ) {
     664                $instance['text'] = $new_instance['text'];
     665            } else {
     666                $instance['text'] = wp_kses_post( $new_instance['text'] );
     667            }
     668            $instance['filter'] = ! empty( $new_instance['filter'] );
     669            return $instance;
     670        }
    622671    }
    623672
  • kopa-page-builder/trunk/inc/fields/class-kpb-field-icon.php

    r1492305 r1694125  
    66
    77        function display() {
    8 
    9             $this->params['options'] = array( '' => esc_html__( '-- select icon --', 'kopa-page-builder' ) );
    10             $icons = self::get_icons();
    11             foreach ( $icons as $icon ) {
    12                 $this->params['options'][ $icon ] = str_replace( 'fa fa-', '', $icon );
     8            if( class_exists( 'Kopa_Framework' ) ) {
     9
     10                $this->params['type'] = 'icon_picker';
     11                $this->params['id']   = KPB_Utility::str_uglify( $this->params['name'] );
     12                echo kopa_form_field_icon_picker( '', '', $this->params , $this->params['value'] );
     13
     14            }else {
     15
     16                $this->params['options'] = array( '' => esc_html__( '-- select icon --', 'kopa-page-builder' ) );
     17                $icons = self::get_icons();
     18                foreach ( $icons as $icon ) {
     19                    $this->params['options'][ $icon ] = str_replace( 'fa fa-', '', $icon );
     20                }
     21                $cbo = new KPB_Field_Select( $this->params );
     22                $cbo->display();
     23
    1324            }
    14 
    15            
    16             $cbo = new KPB_Field_Select( $this->params );
    17             $cbo->display();       
    1825        }
    1926
  • kopa-page-builder/trunk/kopa-page-builder.php

    r1563250 r1694125  
    88 * Plugin Name: Kopa Page Builder
    99 * Description: Kopa Page Builder plugin helps you create static pages by manually adding, editing or moving the widgets to the expected sidebars. Unlike the other Page Builder plugins which available on WordPress.org now, this plugin requires a deep understanding of technical knowledge and WordPress to use for your website.
    10  * Version: 2.0.7
     10 * Version: 2.0.8
    1111 * Author: Kopa Theme
    1212 * Author URI: http://kopatheme.com/
  • kopa-page-builder/trunk/readme.txt

    r1563250 r1694125  
    44Requires at least: 4.4
    55Tested up to: 4.7
    6 Stable tag: 2.0.7
     6Stable tag: 2.0.8
    77
    88== Description ==
     
    2727
    2828== Changelog ==
     29
     30= 2.0.8 =
     31* Inherit field "icon_picker" from plugin "Kopa Framework"
     32* Fixed Widget Text in WordPress 4.8
    2933
    3034= 2.0.7 =
Note: See TracChangeset for help on using the changeset viewer.