cptui_post_type_enqueue_scripts

Add our cptui.js file, with dependencies on jQuery and jQuery UI.

Description

cptui_post_type_enqueue_scripts(); 

Usage

  1. if ( !function_exists( 'cptui_post_type_enqueue_scripts' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'custom-post-type-ui/inc/post-types.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = cptui_post_type_enqueue_scripts(); 
  7.  

Defined (1)

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

/inc/post-types.php  
  1. function cptui_post_type_enqueue_scripts() { 
  2.  
  3. $current_screen = get_current_screen(); 
  4.  
  5. if ( ! is_object( $current_screen ) || 'cpt-ui_page_cptui_manage_post_types' !== $current_screen->base ) { 
  6. return; 
  7.  
  8. if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { 
  9. return; 
  10.  
  11. wp_enqueue_media(); 
  12. wp_enqueue_script( 'cptui' ); 
  13. wp_localize_script( 'cptui', 'cptui_type_data',  
  14. array( 
  15. 'confirm' => esc_html__( 'Are you sure you want to delete this? Deleting will NOT remove created content.', 'custom-post-type-ui' ),  
  16. );