Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created February 16, 2012 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/1846221 to your computer and use it in GitHub Desktop.
Save billerickson/1846221 to your computer and use it in GitHub Desktop.
<?php
function enqueue_scripts_and_styles() {
// Use this filter to limit where the scripts are enqueued.
$show = apply_filters( 'be_flex_slider_show_scripts', true );
if ( true === $show ) {
wp_enqueue_style( 'flex-slider', plugins_url( 'flexslider.css', __FILE__ ) );
wp_enqueue_script( 'jquery ');
wp_enqueue_script( 'flex-slider', plugins_url( 'jquery.flexslider-min.js', __FILE__ ), array( 'jquery' ) );
add_action( 'wp_head', array( $this, 'flex_slider_settings' ) );
}
}
@jaredatch
Copy link

I think since flex-slider has jquery listed as a dependancy you don't need to enqueue it before hand?

@billerickson
Copy link
Author

That might be true. I'll need to test it before I start doing it that way :)

This was to show someone in an email how to disable the flex slider scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment