advantage_load_template_scripts

The Advantage advantage load template scripts function.

Description

advantage_load_template_scripts( $hooks ); 

Parameters (1)

0. $hooks
The hooks.

Usage

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

Defined (1)

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

/inc/lib-admin.php  
  1. function advantage_load_template_scripts( $hooks ) { 
  2. global $post_type; 
  3.  
  4. $tmp_path = get_template_directory_uri(); 
  5.  
  6. if ( 'page' == $post_type ) { 
  7. wp_enqueue_script( 'advantage-template', $tmp_path . '/js/template.js', array( 'jquery') );  
  8. if ( 'widgets.php' == $hooks ) { 
  9. wp_enqueue_media(); 
  10.  
  11. wp_enqueue_style( 'advantage-widgets', $tmp_path . '/css/widgets.css', null, '1.0' );  
  12. wp_enqueue_script( 'advantage-widgets', $tmp_path . '/js/widgets.js', array( 'jquery-ui-sortable' ) );