videopress_handle_editor_view_js

WordPress Shortcode Editor View JS Code.

Description

videopress_handle_editor_view_js(); 

Usage

  1. if ( !function_exists( 'videopress_handle_editor_view_js' ) ) { 
  2. require_once '/modules/videopress/editor-media-view.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = videopress_handle_editor_view_js(); 
  7.  

Defined (1)

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

/modules/videopress/editor-media-view.php  
  1. function videopress_handle_editor_view_js() { 
  2. global $content_width; 
  3. $current_screen = get_current_screen(); 
  4. if ( ! isset( $current_screen->id ) || $current_screen->base !== 'post' ) { 
  5. return; 
  6.  
  7. add_action( 'admin_print_footer_scripts', 'videopress_editor_view_js_templates' ); 
  8.  
  9. wp_enqueue_style( 'videopress-editor-ui', plugins_url( 'css/editor.css', __FILE__ ) ); 
  10. wp_enqueue_script( 'videopress-editor-view', plugins_url( 'js/editor-view.js', __FILE__ ), array( 'wp-util', 'jquery' ), false, true ); 
  11. wp_localize_script( 'videopress-editor-view', 'vpEditorView', array( 
  12. 'home_url_host' => parse_url( home_url(), PHP_URL_HOST ),  
  13. 'min_content_width' => VIDEOPRESS_MIN_WIDTH,  
  14. 'content_width' => $content_width,  
  15. 'modal_labels' => array( 
  16. 'title' => esc_html__( 'VideoPress Shortcode', 'jetpack' ),  
  17. 'guid' => esc_html__( 'Video ID', 'jetpack' ),  
  18. 'w' => esc_html__( 'Video Width', 'jetpack' ),  
  19. 'w_unit' => esc_html__( 'pixels', 'jetpack' ),  
  20. /** Translators: example of usage of this is "Start Video After 10 seconds" */ 
  21. 'at' => esc_html__( 'Start Video After', 'jetpack' ),  
  22. 'at_unit' => esc_html__( 'seconds', 'jetpack' ),  
  23. 'hd' => esc_html__( 'High definition on by default', 'jetpack' ),  
  24. 'permalink' => esc_html__( 'Link the video title to its URL on VideoPress.com', 'jetpack' ),  
  25. 'autoplay' => esc_html__( 'Autoplay video on page load', 'jetpack' ),  
  26. 'loop' => esc_html__( 'Loop video playback', 'jetpack' ),  
  27. 'freedom' => esc_html__( 'Use only Open Source codecs (may degrade performance)', 'jetpack' ),  
  28. 'flashonly' => esc_html__( 'Use legacy Flash Player (not recommended)', 'jetpack' ),  
  29. ) ); 
  30.  
  31. add_editor_style( plugins_url( 'css/videopress-editor-style.css', __FILE__ ) );