Plugin Directory

Changeset 1297629


Ignore:
Timestamp:
11/30/2015 07:18:26 PM (10 years ago)
Author:
luizrw
Message:

fixed version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lrw-photoswipe-gallery/branches/1.0.1/lrw-photoswipe-gallery.php

    r1297624 r1297629  
    6161            add_filter( 'wp_get_attachment_link', array( &$this, 'data_size' ), 10, 6 );
    6262            add_filter( 'post_gallery', array( &$this, 'photoswipe_gallery' ), 10, 2 );
    63 
    64             if ( get_option('photoswipe_settings') == 1 ) {
    65                 if ( is_singular() ) {
    66                     add_filter( 'wp_enqueue_scripts', array( &$this, 'setup_scripts' ) );
    67                     add_filter( 'wp_footer', array( &$this, 'photoswipe_ui_options' ) );
    68                     add_filter( 'wp_footer', array( &$this, 'photoswipe_html_footer' ) );
    69                 }
    70             } else {
    71                 add_filter( 'wp_enqueue_scripts', array( &$this, 'setup_scripts' ) );
    72                 add_filter( 'wp_footer', array( &$this, 'photoswipe_ui_options' ) );
    73                 add_filter( 'wp_footer', array( &$this, 'photoswipe_html_footer' ) );
    74             }
     63            add_filter( 'wp_enqueue_scripts', array( &$this, 'setup_scripts' ) );
     64            add_filter( 'wp_footer', array( &$this, 'photoswipe_html_footer' ) );
     65            add_filter( 'wp_footer', array( &$this, 'photoswipe_ui_options' ) );
    7566        }
    7667
     
    333324         */
    334325        function setup_scripts() {
    335             wp_enqueue_script( 'photoswipe-lib', plugin_dir_url( __FILE__ ) . 'assets/js/photoswipe.min.js', array() );
    336             wp_enqueue_script( 'photoswipe', plugin_dir_url( __FILE__ ) . 'assets/js/photoswipe-init.js', array( 'photoswipe-lib', 'jquery' ) );
    337             wp_enqueue_style( 'photoswipe-lib', plugin_dir_url( __FILE__ ) . 'assets/css/photoswipe.css', false );
    338             wp_enqueue_style( 'photoswipe-default-skin', plugin_dir_url( __FILE__ ) . 'assets/css/default-skin/default-skin.css ', false );
     326            $options = get_option('photoswipe_settings');
     327
     328            if ( $options['active_conditional'] == 1 ) {
     329                if ( is_singular() ) {
     330                    wp_enqueue_script( 'photoswipe-lib', plugin_dir_url( __FILE__ ) . 'assets/js/photoswipe.min.js', array() );
     331                    wp_enqueue_script( 'photoswipe', plugin_dir_url( __FILE__ ) . 'assets/js/photoswipe-init.js', array( 'photoswipe-lib', 'jquery' ) );
     332                    wp_enqueue_style( 'photoswipe-lib', plugin_dir_url( __FILE__ ) . 'assets/css/photoswipe.css', false );
     333                    wp_enqueue_style( 'photoswipe-default-skin', plugin_dir_url( __FILE__ ) . 'assets/css/default-skin/default-skin.css ', false );
     334                }
     335            }
    339336        }
    340337
Note: See TracChangeset for help on using the changeset viewer.