Plugin Directory

Changeset 1650697


Ignore:
Timestamp:
05/04/2017 03:10:40 AM (9 years ago)
Author:
kosinix
Message:

To trunk 3.1.2

Location:
cyclone-slider/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • cyclone-slider/trunk/README.txt

    r1647737 r1650697  
    119119== Changelog ==
    120120
     121= 3.1.2 - 2017-05-04 =
     122* Fix "Slideshow not found" error when using numeric slideshow slugs. Eg. "011".
     123
    121124= 3.1.1 - 2017-04-29 =
    122125* Fix slide type image edit area not showing when adding slide for the first time.
  • cyclone-slider/trunk/cyclone-slider.php

    r1647737 r1650697  
    44Plugin URI: http://www.codefleet.net/cyclone-slider/
    55Description: Create and manage sliders with ease. Built for both casual users and developers.
    6 Version: 3.1.1
     6Version: 3.1.2
    77Author: Nico Amarilla
    88Author URI: http://www.codefleet.net/
  • cyclone-slider/trunk/src/CycloneSlider/Data.php

    r1646975 r1650697  
    244244    }
    245245   
     246    /**
     247     * @param $slug Post slug
     248     *
     249     * @return array|NULL
     250     */
     251    public function get_slider_by_slug( $slug ){
     252        global $wp_version;
     253
     254        $args = array(
     255            'numberposts' => 1 // 1 only
     256        );
     257
     258        $args['name'] = $slug;
     259        if ( version_compare( $wp_version, '4.4', '>=' ) ) { // post_name__in avail only in 4.4
     260            $args['post_name__in'] = array( $slug ); // Workaround: Using "post_name__in" not "name" as WP returns a post instead of nothing when name is ''.
     261        }
     262       
     263        $sliders = $this->get_sliders( $args );
     264        return array_pop($sliders); // Return the lone slideshow or NULL if empty
     265    }
     266
    246267    /**
    247268     * @param $id_or_slug
  • cyclone-slider/trunk/src/CycloneSlider/Exporter.php

    r1635527 r1650697  
    9898        foreach( $sliders_slugs_array as $i=>$slider_slug){
    9999
    100             $slider = $this->data->get_slider( $slider_slug );
     100            $slider = $this->data->get_slider_by_slug( $slider_slug );
    101101           
    102102            if($slider){
  • cyclone-slider/trunk/src/CycloneSlider/Frontend.php

    r1646975 r1650697  
    9595
    9696        $slider_slug = $shortcode_settings['id']; // Slideshow slug passed from shortcode
    97         $slider      = $this->data->get_slider( $slider_slug ); // Get slider by slug
     97        $slider      = $this->data->get_slider_by_slug( $slider_slug ); // Get slider by slug
    9898
    9999        // Abort if slider not found!
  • cyclone-slider/trunk/src/functions.php

    r1635527 r1650697  
    11<?php
    2 /**
    3  * Cyclone Slider
    4  *
    5  * Displays the slider on template files.
    6  *
    7  * @param string $slider_slug The slug of the slider.
    8  */
    9 function cyclone_slider( $slider_slug ){
    10     global $cyclone_slider_plugin_instance;
    11     if(isset($cyclone_slider_plugin_instance)){
    12         echo $cyclone_slider_plugin_instance['frontend']->cycloneslider_shortcode( array('id'=>$slider_slug) );
    13     }
    14 }
     2
    153
    164/**
  • cyclone-slider/trunk/src/plugin.php

    r1646975 r1650697  
    139139}
    140140
     141// PHP embed code function
     142/**
     143 * Cyclone Slider
     144 *
     145 * Displays the slider on template files.
     146 *
     147 * @param string $slider_slug The slug of the slider.
     148 */
     149function cyclone_slider( $slider_slug ){
     150    global $cyclone_slider_plugin_instance;
     151    if(isset($cyclone_slider_plugin_instance)){
     152        echo $cyclone_slider_plugin_instance['frontend']->cycloneslider_shortcode( array('id'=>$slider_slug) );
     153    }
     154}
     155
    141156// Service Definitions
    142157function cs3_service_plugin_headers( $plugin ){
Note: See TracChangeset for help on using the changeset viewer.