Plugin Directory

Changeset 1214295


Ignore:
Timestamp:
08/06/2015 06:23:10 PM (11 years ago)
Author:
bboy8k
Message:

Release version 1.1

Location:
penci-slider
Files:
41 added
3 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • penci-slider/trunk/inc/shortcode.php

    r1212241 r1214295  
    1414            'category'   => '',
    1515            'height'     => '',
    16             'order'      => 'ASC',
    1716            'transition' => 'slide',
    1817            'autoplay'   => 'true',
     
    2625        if ( ! is_numeric( $container ) ) : $container = '1000'; endif;
    2726        if ( ! is_numeric( $height ) ) : $height = ''; endif;
    28         if ( $order != 'DESC' && $order != 'desc' ) : $order = 'ASC'; endif;
    29         $order = strtoupper($order);
    3027        if ( $transition != 'fade' ) : $transition = 'slide'; endif;
    3128        if ( $autoplay != 'false' ): $autoplay = 'true'; endif;
     
    4138        $slider_args = array(
    4239            'post_type' => 'penci_slider',
    43             'order'      => $order,
     40            'order'     => 'ASC',
     41            'orderby'   => 'menu_order'
    4442        );
    4543
  • penci-slider/trunk/init.php

    r1212241 r1214295  
    44Plugin URI: http://pencidesign.com/
    55Description: Easy to create a WordPress slider, full responsive, nice element transition and SEO optimized.
    6 Version: 1.0
     6Version: 1.1
    77Author: PenciDesign
    88Author URI: http://pencidesign.com/
     
    9191            add_action( 'admin_print_styles', array( $this, 'enqueue_media' ) );
    9292
    93             // load plugin text domain for translations
     93            // Load plugin text domain for translations
    9494            add_action( 'plugins_loaded', array( $this, 'load_text_domain' ) );
    9595
     
    9797            add_action( 'wp_enqueue_scripts', array( $this, 'front_style' ) );
    9898
    99             // enqueue script and style in back-end
     99            // Ajax action to update reorder
     100            add_action( 'wp_ajax_penci_update_slide_order', array( $this, 'penci_slider_update_order' ) );
     101
     102            // Reorder default columns pencislider in backend
     103            add_filter( 'pre_get_posts', array( $this, 'set_penci_slider_admin_order' ) );
     104
     105            // Enqueue script and style in back-end
    100106            add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue' ) );
    101107
    102             // add settings link to plugins page
     108            // Add settings link to plugins page
    103109            add_filter( 'plugin_action_links', array( $this, 'add_settings_links' ), 10, 2 );
    104110
    105             // register admin options
     111            // Register admin options
    106112            add_action( 'admin_init', array( $this, 'admin_options' ) );
    107113
    108             // add plugin options page
     114            // Add plugin options page
    109115            add_action( 'admin_menu', array( $this, 'add_options_page' ) );
    110116
    111             // add custom options
     117            // Add custom options
    112118            add_action( 'wp_head', array( $this, 'custom_options' ) );
    113119        }
     
    389395        public function admin_enqueue() {
    390396            wp_enqueue_style( 'pencislider-admin-css', PENCI_SLIDER_URL . '/css/admin.css' );
    391             wp_register_script( 'pencislider-admin-js', PENCI_SLIDER_URL . '/js/admin.js', false, self::$version );
     397            wp_enqueue_script( 'jquery-ui-sortable', array( 'jquery' ) );
     398            wp_enqueue_script( 'reorder-slides', PENCI_SLIDER_URL . '/js/reorder.js', array( 'jquery' ), false, self::$version );
     399            wp_register_script( 'pencislider-admin-js', PENCI_SLIDER_URL . '/js/admin.js', array( 'jquery' ), false, self::$version );
     400        }
     401
     402        /**
     403         * Reorder ajax callback
     404         * @return void
     405         * @since 1.1
     406         */
     407        public function penci_slider_update_order() {
     408            global $wpdb;
     409
     410            $post_type = $_POST['postType'];
     411            $order     = $_POST['order'];
     412
     413            if ( ! is_array( $order ) || $post_type != 'penci_slider' )
     414                return;
     415
     416            foreach ( $order as $menu_order => $post_id ) {
     417                $post_id    = intval( str_ireplace( 'post-', '', $post_id ) );
     418                $menu_order = intval( $menu_order );
     419
     420                wp_update_post( array(
     421                        'ID'         => stripslashes( htmlspecialchars( $post_id ) ),
     422                        'menu_order' => stripslashes( htmlspecialchars( $menu_order ) )
     423                    ) );
     424            }
     425            die( '1' );
     426        }
     427
     428        /**
     429         * Order the default penci slider page correctly
     430         * @return void
     431         * @since 1.0
     432         */
     433        public function set_penci_slider_admin_order( $wp_query ) {
     434            if ( is_admin() ) {
     435                $post_type = $wp_query->query['post_type'];
     436
     437                if ( $post_type == 'penci_slider' ) {
     438                    $wp_query->set( 'orderby', 'menu_order' );
     439                    $wp_query->set( 'order', 'ASC' );
     440                }
     441            }
    392442        }
    393443
  • penci-slider/trunk/mce/js/mce.js

    r1212241 r1214295  
    2424                                    { type: 'textbox', name: 'category', label: 'Category Name to filter slides' },
    2525                                    { type : 'textbox', name : 'height', label: 'Slider Height(numeric value only, want smooth height let empty it)' },
    26                                     { type : 'listbox', name : 'order', label: 'Slides Order', 'values': [{ text: 'Ascending', value: 'asc' }, { text: 'Descending', value: 'desc' }] },
    2726                                    { type    : 'listbox', name    : 'transition', label   : 'Slider Transition', 'values': [{ text: 'Slide', value: 'slide' }, { text: 'Fade', value: 'fade' }] },
    2827                                    { type    : 'listbox', name    : 'autoplay', label   : 'Auto Play Slider?', 'values': [{ text: 'Yes', value: 'true' }, { text: 'No', value: 'false' }] },
  • penci-slider/trunk/readme.txt

    r1213948 r1214295  
    55Requires at least: 3.9
    66Tested up to: 4.3
    7 Stable tag: 1.0
     7Stable tag: 1.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1313== Description ==
    1414
    15 http://www.youtube.com/watch?v=rbYXlOAdoYU
    16 
    1715Creating slideshows with [Penci Slider](http://pencidesign.com/) is fast and very easy.
    1816
     
    2119<h4>PenciSlider Features:</h4>
    2220* Simple, easy to use - perfect for individual users, developers & clients
     21* New in version 1.1: Drag Drop to reorder slides
    2322* Full Responsive design, SEO optimized slideshows
    2423* Use shortcode to display everywhere you want
     
    3231* Set image crop position
    3332* WordPress Multi Site compatible
    34 * Compatible with translation plugins (qTranslate & WPML, PolyLang)
     33* Transition ready
    3534* Loading is optimized
    3635
     
    7473
    7574== Changelog ==
     75= 1.1=
     76* Add : Drag Drop to Reorder Slides
     77* Add : Transition ready to Penci Slider
     78* Remove: order parametters in penci_slider shortcode
     79
    7680= 1.0 =
    7781* Just release 1.0
Note: See TracChangeset for help on using the changeset viewer.