Placester Real Estate Pro plugin settings page.', pls_get_textdomain() ); elseif ( pls_has_plugin_error() == 'no_plugin' ) $l10n['no_plugin'] = __( 'This theme needs the Placester Real Estate Pro plugin to work.', pls_get_textdomain() ); wp_localize_script( 'pls-plugin-nags', 'messages', $l10n ); } /** Get theme-supported js modules. */ $js = get_theme_support( 'pls-js' ); /** If there is no support, return. */ if ( ! is_array( $js[0] ) ) return; /** * The "Chosen" script. * Deal with it only theme support has been added. * {@link: http://harvesthq.github.com/chosen/} */ if ( array_key_exists( 'chosen', $js[0] ) ) { /** Register the script and style. */ wp_register_script( 'chosen', trailingslashit( PLS_JS_URL ) . 'libs/chosen/chosen.jquery.min.js' , array( 'jquery' ), NULL, true ); wp_register_script( 'chosen-custom', trailingslashit( PLS_JS_URL ) . 'libs/chosen/chosen-custom.js' , array( 'jquery' ), NULL, true ); wp_register_style( 'chosen', trailingslashit( PLS_JS_URL ) . 'libs/chosen/chosen.css' ); /** Enqueue scrip and styles only if supported. */ if ( is_array( $js[0]['chosen'] ) ) { if ( in_array( 'script', $js[0]['chosen'] ) ) { wp_enqueue_script( 'chosen' ); wp_enqueue_script( 'chosen-custom' ); } /** Enqueue the chosen style */ if ( in_array( 'style', $js[0]['chosen'] ) ) wp_enqueue_style( 'chosen' ); } } if ( array_key_exists( 'floating', $js[0] ) ) { /** Register the script and style. */ wp_register_script( 'floating', trailingslashit( PLS_JS_URL ) . 'scripts/floating.js' , array( 'jquery'), NULL, true ); /** Enqueue scrip and styles only if supported. */ if ( is_array( $js[0]['floating'] ) ) { if ( in_array( 'script', $js[0]['floating'] ) ) { wp_enqueue_script( 'floating' ); } } } } /** * Enqueues scripts before the ones added with 'wp_enqueue_script' * * @since 0.0.1 */ add_action( 'wp_head', 'pls_print_header_scripts', 8 ); function pls_print_header_scripts() { /** Load Google CDN jQuery and its fallback before everything else */ wp_print_scripts( 'jquery' ); echo '' . "\n"; /** Load Modernizr */ wp_print_scripts( 'modernizr' ); } }