optionsframework_load_scripts

Loads the javascript.

Description

optionsframework_load_scripts( $hook ); 

Parameters (1)

0. $hook
The hook.

Usage

  1. if ( !function_exists( 'optionsframework_load_scripts' ) ) { 
  2. require_once '/inc/options-framework.php'; 
  3.  
  4. // The hook. 
  5. $hook = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = optionsframework_load_scripts($hook); 
  9.  

Defined (1)

The function is defined in the following location(s).

/inc/options-framework.php  
  1. function optionsframework_load_scripts( $hook ) { 
  2.  
  3.  
  4. if ( 'appearance_page_' . $menu['menu_slug'] != $hook ) 
  5. return; 
  6.  
  7. // Enqueue colorpicker scripts for versions below 3.5 for compatibility 
  8. if ( !wp_script_is( 'wp-color-picker', 'registered' ) ) { 
  9. wp_enqueue_script( 'iris', false, array( 'jquery', 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 ); 
  10. wp_register_script( 'wp-color-picker', OPTIONS_FRAMEWORK_DIRECTORY . 'js/color-picker.min.js', array( 'jquery', 'iris' ) ); 
  11. $colorpicker_l10n = array( 
  12. 'clear' => __( 'Clear', 'options_framework_theme' ),  
  13. 'defaultString' => __( 'Default', 'options_framework_theme' ),  
  14. 'pick' => __( 'Select Color', 'options_framework_theme' ) 
  15. ); 
  16. wp_localize_script( 'wp-color-picker', 'wpColorPickerL10n', $colorpicker_l10n ); 
  17.  
  18. // Enqueue custom option panel JS 
  19. wp_enqueue_script( 'options-custom', OPTIONS_FRAMEWORK_DIRECTORY . 'js/options-custom.js', array( 'jquery', 'wp-color-picker' ) ); 
  20.  
  21. // Inline scripts from options-interface.php 
  22. add_action( 'admin_head', 'of_admin_head' );