Changeset 1297628
- Timestamp:
- 11/30/2015 07:17:44 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lrw-photoswipe-gallery/tags/1.0.1/lrw-photoswipe-gallery.php
r1297627 r1297628 61 61 add_filter( 'wp_get_attachment_link', array( &$this, 'data_size' ), 10, 6 ); 62 62 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' ) ); 75 66 } 76 67 … … 333 324 */ 334 325 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 } 339 336 } 340 337
Note: See TracChangeset
for help on using the changeset viewer.