public static function add_quicktag_button_script()
{
static $once = false;
if ($once || !self::$scripts_url) {
return;
}
$current_screen = get_current_screen();
if (empty(self::$buttons_data) || !isset($current_screen->parent_base) || $current_screen->parent_base != 'edit') {
return;
}
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
wp_enqueue_script(self::$handle, self::url("js/shortcode-quicktag-button{$suffix}.js"), array('jquery', 'quicktags'), self::VERSION, true);
// wp-jquery-ui-dialog css still needed as we're borrowing some dialog markup.
wp_enqueue_style(self::$handle, self::url("css/shortcode-button{$suffix}.css"), array('wp-jquery-ui-dialog'), self::VERSION);
wp_localize_script(self::$handle, 'shortcodeButtonsl10n', array_reverse(self::$buttons_data));
self::$buttons_data = array();
include_once self::$dir . 'templates/modal.php';
$once = true;
}