function wp_print_head_scripts() { if (!did_action('wp_print_scripts')) { /** This action is documented in wp-includes/functions.wp-scripts.php */ do_action('wp_print_scripts'); } global $wp_scripts; if (!$wp_scripts instanceof WP_Scripts) { return array(); // no need to run if nothing is queued } return print_head_scripts(); }
function loadShortcodes() { ! defined( 'CONCATENATE_SCRIPTS' ) && define( 'CONCATENATE_SCRIPTS', false ); $this->setPost(); $shortcodes = (array)vc_post_param( 'shortcodes' ); $this->renderShortcodes( $shortcodes ); echo '<div data-type="files">'; _print_styles(); print_head_scripts(); print_late_styles(); print_footer_scripts(); echo '</div>'; die(); }
/** * Prints the script queue in the HTML head on the front end. * * Postpones the scripts that were queued for the footer. * wp_print_footer_scripts() is called in the footer to print these scripts. * * @since 2.8 */ function wp_print_head_scripts() { if (!did_action('wp_print_scripts')) { do_action('wp_print_scripts'); } global $wp_scripts; if (!is_a($wp_scripts, 'WP_Scripts')) { return array(); } // no need to run if nothing is queued return print_head_scripts(); }
<div id="vc_template-html"> <?php echo $editor->parseShortcodesString($editor->getTemplateContent()); ?> <div data-type="files"> <?php _print_styles(); print_head_scripts(); print_late_styles(); print_footer_scripts(); ?> </div> </div> <div id="vc_template-data"><?php echo esc_html_e(json_encode($editor->post_shortcodes)); ?> </div>
/** * */ function loadShortcodes() { if (is_user_logged_in()) { $action = vc_post_param('action'); if ($action == 'vc_load_shortcode') { !defined('CONCATENATE_SCRIPTS') && define('CONCATENATE_SCRIPTS', false); ob_start(); $this->setPost(); $shortcodes = (array) vc_post_param('shortcodes'); do_action('vc_load_shortcode', $shortcodes); $this->renderShortcodes($shortcodes); echo '<div data-type="files">'; _print_styles(); print_head_scripts(); print_late_styles(); print_footer_scripts(); do_action('wp_print_footer_scripts'); echo '</div>'; $output = ob_get_clean(); die(apply_filters('vc_frontend_editor_load_shortcode_ajax_output', $output)); } else { if ($action == 'vc_frontend_default_template') { // @deprecated since 4.4 and will be removed and should not be used, use action 'vc_frontend_default_template_modal' instead and templatesPanelEditor $this->setPost(); visual_composer()->templatesEditor()->renderFrontendDefaultTemplate(); } else { if ($action == 'vc_frontend_template') { // @deprecated since 4.4 and will be removed and should not be used, use action 'vc_frontend_template_modal' instead and templatesPanelEditor $this->setPost(); visual_composer()->templatesEditor()->renderFrontendTemplate(); } else { if ($action == 'vc_frontend_load_template') { $this->setPost(); visual_composer()->templatesPanelEditor()->renderFrontendTemplate(); } } } } } if (vc_post_param('action') != '') { do_action('vc_front_load_page_' . esc_attr(vc_post_param('action'))); } }
/** * Sending output to an iframe */ function pte_init_iframe() { global $title, $pte_iframe; $pte_iframe = true; // Provide the base framework/HTML for the editor. require_once ABSPATH . WPINC . '/script-loader.php'; // Check the input parameters and create the HTML pte_edit_setup(); print "<!DOCTYPE html>\n<html><head><title>{$title}</title>\n"; print_head_scripts(); print_admin_styles(); print '</head><body class="wp-core-ui pte-iframe">'; // Simply echo the created HTML pte_edit_page(); wp_print_footer_scripts(); print '</body></html>'; }
/** * */ function loadShortcodes() { if (vc_is_page_editable() && vc_enabled_frontend()) { $action = vc_post_param('action'); if ('vc_load_shortcode' === $action) { !defined('CONCATENATE_SCRIPTS') && define('CONCATENATE_SCRIPTS', false); ob_start(); $this->setPost(); $shortcodes = (array) vc_post_param('shortcodes'); do_action('vc_load_shortcode', $shortcodes); $this->renderShortcodes($shortcodes); echo '<div data-type="files">'; _print_styles(); print_head_scripts(); print_late_styles(); print_footer_scripts(); do_action('wp_print_footer_scripts'); echo '</div>'; $output = ob_get_clean(); die(apply_filters('vc_frontend_editor_load_shortcode_ajax_output', $output)); } elseif ('vc_frontend_load_template' === $action) { $this->setPost(); visual_composer()->templatesPanelEditor()->renderFrontendTemplate(); } else { if ('' !== $action) { do_action('vc_front_load_page_' . esc_attr(vc_post_param('action'))); } } } }
/** * -- override WP_Scripts/WP_Styles by Puzzler classes through @puzzler_class_changer() */ function puzzler_header_scripts() { if (!did_action('wp_print_scripts')) { do_action('wp_print_scripts'); } puzzler_class_changer(); global $wp_scripts; if (!$wp_scripts instanceof WP_Scripts) { return array(); // no need to run if nothing is queued } return print_head_scripts(); }
function loadShortcodes() { $shortcodes = (array) $this->post('shortcodes'); $this->renderShortcodes($shortcodes); echo '<div data-type="files">'; _print_styles(); print_head_scripts(); print_late_styles(); print_footer_scripts(); echo '</div>'; die; }
/** * Prints the script queue in the HTML head on the front end. * * Postpones the scripts that were queued for the footer. * asc_print_footer_scripts() is called in the footer to print these scripts. * * @since 2.8.0 */ function asc_print_head_scripts() { if (!did_action('asc_print_scripts')) { /** This action is documented in functions.asc-scripts.php */ do_action('asc_print_scripts'); } global $asc_scripts; if (!is_a($asc_scripts, 'ASC_Scripts')) { return array(); } // no need to run if nothing is queued return print_head_scripts(); }
function _displayHead(&$output) { // get line endings $lnEnd = "\n"; $tab = "\t"; $tagEnd = ' />'; $strHtml = ''; // Enqueue Styles $deps = array(); foreach ($this->_styles as $style_priority) { foreach ($style_priority as $strSrc) { if ($strSrc->type == 'local') { $path = parse_url($strSrc->url, PHP_URL_PATH); if ($this->baseUrl != "/") { $path = '/' . preg_replace('#^' . quotemeta($this->baseUrl) . '#', "", $path); } $filename = strtolower(basename($path, '.css')) . rand(0, 1000); wp_enqueue_style($filename, $path, array(), '1.26'); $deps[] = $path; } } } // Add scripts to the header $deps = array(); foreach ($this->_scripts as $strSrc) { $path = parse_url($strSrc, PHP_URL_PATH); if ($this->baseUrl != "/") { $path = '/' . preg_replace('#^' . quotemeta($this->baseUrl) . '#', "", $path); } wp_enqueue_script($path, $path, $deps, '1.26'); $deps[] = $path; } foreach ($this->_full_scripts as $strSrc) { wp_enqueue_script($strSrc, $strSrc, $deps, '1.26'); $deps[] = $strSrc; } if (!$this->isAdmin()) { $strHtml .= $this->_renderCharset(); $strHtml .= $this->_renderTitle(); add_action('wp_head', array($this, '_renderRemoteStyles'), 8); add_action('wp_head', array($this, '_renderRemoteScripts'), 9); ob_start(); wp_head(); $strHtml .= ob_get_clean(); $strHtml .= $this->_renderStylesHead(); $strHtml .= $this->_renderScriptsHead(); } else { ob_start(); $this->_renderRemoteStyles(); print_admin_styles(); $this->_renderRemoteScripts(); print_head_scripts(); $strHtml .= ob_get_clean(); $strHtml .= $this->_renderStylesHead(); $strHtml .= $this->_renderScriptsHead(); } $output = preg_replace("#<gantry:header/>#", $strHtml, $output); }