cf7_style_admin_scripts

The Contact Form 7 Style cf7 style admin scripts function.

Description

cf7_style_admin_scripts( $hook ); 

Parameters (1)

0. $hook
The hook.

Usage

  1. if ( !function_exists( 'cf7_style_admin_scripts' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'contact-form-7-style/cf7-style.php'; 
  3.  
  4. // The hook. 
  5. $hook = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = cf7_style_admin_scripts($hook); 
  9.  

Defined (1)

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

/cf7-style.php  
  1. function cf7_style_admin_scripts($hook) { 
  2. global $post_type; 
  3. if (!wp_script_is( 'jquery', 'enqueued' )) { 
  4. wp_enqueue_script('jquery'); 
  5. wp_enqueue_style( "cf7-style-bar-style", WPCF7S_LOCATION . "css/admin-bar.css", array(), WPCF7S_PLUGIN_VER, "all"); 
  6. wp_enqueue_script( "cf7_style_overall", WPCF7S_LOCATION . "admin/js/overall-min.js", array('jquery'), WPCF7S_PLUGIN_VER, true ); 
  7. if( 'cf7_style_page_cf7style-css-editor' == $hook ) { 
  8. wp_enqueue_script( "cf7_style_codemirror_js", WPCF7S_LOCATION . "admin/js/codemirror.js", array( 'jquery' ), WPCF7S_PLUGIN_VER, true ); 
  9. wp_enqueue_style( "cf7-style-codemirror-style", WPCF7S_LOCATION . "admin/css/codemirror.css", array(), WPCF7S_PLUGIN_VER, "all" ); 
  10. wp_enqueue_script( "cf7-style-codemirror-mode", WPCF7S_LOCATION . "admin/js/mode/css/css.js", array( 'jquery' ), WPCF7S_PLUGIN_VER, true ); 
  11. if( 'cf7_style' == $post_type) { 
  12. wp_enqueue_style( 'wp-color-picker' ); 
  13. wp_enqueue_script( 'thickbox' ); 
  14. wp_enqueue_style( 'thickbox' ); 
  15. wp_enqueue_script( 'media-upload' ); 
  16. if( 'plugins.php'== $hook || 'cf7_style' == $post_type || 'toplevel_page_wpcf7' == $hook || 'cf7_style_page_cf7style-css-editor' == $hook || 'cf7_style_page_system-status' == $hook || 'cf7_style_page_cf7style-settings' == $hook ) { 
  17. wp_enqueue_style('cf7-style-font-awesome', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.6.2/css/font-awesome.min.css'); 
  18. wp_enqueue_style( "cf7-style-admin-style", WPCF7S_LOCATION . "admin/css/admin.css", false, WPCF7S_PLUGIN_VER, "all");  
  19. wp_enqueue_script( "cf7_style_admin_js", WPCF7S_LOCATION . "admin/js/admin-min.js", array( 'wp-color-picker', 'jquery' ), WPCF7S_PLUGIN_VER, true );