/** * Enqueues styles and scripts necessary for the media upload button. * * @since 2.2.12 */ static function localizeScript() { // Return if function doesn't exist if (!function_exists('get_current_screen') || self::$localizedScript) { return; } // Return when not on a slideshow edit page, or files have already been included. $currentScreen = get_current_screen(); if ($currentScreen->post_type != SlideshowPluginPostType::$postType) { return; } wp_localize_script('slideshow-jquery-image-gallery-backend-script', 'slideshow_jquery_image_gallery_backend_script_editSlideshow', array('data' => array(), 'localization' => array('confirm' => __('Are you sure you want to delete this slide?', 'slideshow-plugin'), 'uploaderTitle' => __('Insert image slide', 'slideshow-plugin')))); // Set enqueued to true self::$localizedScript = true; }