当前位置: 首页>>代码示例>>PHP>>正文


PHP script_concat_settings函数代码示例

本文整理汇总了PHP中script_concat_settings函数的典型用法代码示例。如果您正苦于以下问题:PHP script_concat_settings函数的具体用法?PHP script_concat_settings怎么用?PHP script_concat_settings使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了script_concat_settings函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: print_footer_scripts

 public function print_footer_scripts()
 {
     global $concatenate_scripts;
     if (!did_action('shopp_print_footer_scripts')) {
         do_action('shopp_print_footer_scripts');
     }
     script_concat_settings();
     $concatenate_scripts = defined('CONCATENATE_SCRIPTS') ? CONCATENATE_SCRIPTS : true;
     $this->do_concat = $concatenate_scripts;
     $this->do_footer_items();
     if (apply_filters('shopp_print_footer_scripts', true)) {
         $this->print_script_request();
     }
     $this->reset();
     return $this->done;
 }
开发者ID:BlessySoftwares,项目名称:anvelocom,代码行数:16,代码来源:Scripts.php

示例2: editor_js

    /**
     *
     * @static
     * @global string $wp_version
     * @global string $tinymce_version
     * @global bool   $concatenate_scripts
     * @global bool   $compress_scripts
     */
    public static function editor_js()
    {
        global $wp_version, $tinymce_version, $concatenate_scripts, $compress_scripts;
        /**
         * Filters "tiny_mce_version" is deprecated
         *
         * The tiny_mce_version filter is not needed since external plugins are loaded directly by TinyMCE.
         * These plugins can be refreshed by appending query string to the URL passed to "mce_external_plugins" filter.
         * If the plugin has a popup dialog, a query string can be added to the button action that opens it (in the plugin's code).
         */
        $version = 'ver=' . $tinymce_version;
        $tmce_on = !empty(self::$mce_settings);
        if (!isset($concatenate_scripts)) {
            script_concat_settings();
        }
        $compressed = $compress_scripts && $concatenate_scripts && isset($_SERVER['HTTP_ACCEPT_ENCODING']) && false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip');
        $mceInit = $qtInit = '';
        if ($tmce_on) {
            foreach (self::$mce_settings as $editor_id => $init) {
                $options = self::_parse_init($init);
                $mceInit .= "'{$editor_id}':{$options},";
            }
            $mceInit = '{' . trim($mceInit, ',') . '}';
        } else {
            $mceInit = '{}';
        }
        if (!empty(self::$qt_settings)) {
            foreach (self::$qt_settings as $editor_id => $init) {
                $options = self::_parse_init($init);
                $qtInit .= "'{$editor_id}':{$options},";
            }
            $qtInit = '{' . trim($qtInit, ',') . '}';
        } else {
            $qtInit = '{}';
        }
        $ref = array('plugins' => implode(',', self::$plugins), 'theme' => 'modern', 'language' => self::$mce_locale);
        $suffix = SCRIPT_DEBUG ? '' : '.min';
        /**
         * Fires immediately before the TinyMCE settings are printed.
         *
         * @since 3.2.0
         *
         * @param array $mce_settings TinyMCE settings array.
         */
        do_action('before_wp_tiny_mce', self::$mce_settings);
        ?>

		<script type="text/javascript">
		tinyMCEPreInit = {
			baseURL: "<?php 
        echo self::$baseurl;
        ?>
",
			suffix: "<?php 
        echo $suffix;
        ?>
",
			<?php 
        if (self::$drag_drop_upload) {
            echo 'dragDropUpload: true,';
        }
        ?>
			mceInit: <?php 
        echo $mceInit;
        ?>
,
			qtInit: <?php 
        echo $qtInit;
        ?>
,
			ref: <?php 
        echo self::_parse_init($ref);
        ?>
,
			load_ext: function(url,lang){var sl=tinymce.ScriptLoader;sl.markDone(url+'/langs/'+lang+'.js');sl.markDone(url+'/langs/'+lang+'_dlg.js');}
		};
		</script>
		<?php 
        $baseurl = self::$baseurl;
        // Load tinymce.js when running from /src, else load wp-tinymce.js.gz (production) or tinymce.min.js (SCRIPT_DEBUG)
        $mce_suffix = false !== strpos($wp_version, '-src') ? '' : '.min';
        if ($tmce_on) {
            if ($compressed) {
                echo "<script type='text/javascript' src='{$baseurl}/wp-tinymce.php?c=1&amp;{$version}'></script>\n";
            } else {
                echo "<script type='text/javascript' src='{$baseurl}/tinymce{$mce_suffix}.js?{$version}'></script>\n";
                echo "<script type='text/javascript' src='{$baseurl}/plugins/compat3x/plugin{$suffix}.js?{$version}'></script>\n";
            }
            echo "<script type='text/javascript'>\n" . self::wp_mce_translation() . "</script>\n";
            if (self::$ext_plugins) {
                // Load the old-format English strings to prevent unsightly labels in old style popups
                echo "<script type='text/javascript' src='{$baseurl}/langs/wp-langs-en.js?{$version}'></script>\n";
//.........这里部分代码省略.........
开发者ID:BoldGrid,项目名称:WordPress,代码行数:101,代码来源:class-wp-editor.php

示例3: print_admin_styles

/**
 * Prints the styles queue in the HTML head on admin pages.
 *
 * @since 2.8
 */
function print_admin_styles()
{
    global $wp_styles, $concatenate_scripts, $compress_css;
    if (!is_a($wp_styles, 'WP_Styles')) {
        $wp_styles = new WP_Styles();
    }
    script_concat_settings();
    $wp_styles->do_concat = $concatenate_scripts;
    $zip = $compress_css ? 1 : 0;
    if ($zip && defined('ENFORCE_GZIP') && ENFORCE_GZIP) {
        $zip = 'gzip';
    }
    $wp_styles->do_items(false);
    if (apply_filters('print_admin_styles', true)) {
        _print_styles();
    }
    $wp_styles->reset();
    return $wp_styles->done;
}
开发者ID:jawandsingh,项目名称:wordpress_with_sql_azure,代码行数:24,代码来源:script-loader.php

示例4: wp_tiny_mce


//.........这里部分代码省略.........
    }
    $plugins = implode($plugins, ',');
    if ($teeny) {
        $mce_buttons = apply_filters('teeny_mce_buttons', array('bold, italic, underline, blockquote, separator, strikethrough, bullist, numlist,justifyleft, justifycenter, justifyright, undo, redo, link, unlink, fullscreen'));
        $mce_buttons = implode($mce_buttons, ',');
        $mce_buttons_2 = $mce_buttons_3 = $mce_buttons_4 = '';
    } else {
        $mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', '|', 'bullist', 'numlist', 'blockquote', '|', 'justifyleft', 'justifycenter', 'justifyright', '|', 'link', 'unlink', 'wp_more', '|', 'spellchecker', 'fullscreen', 'wp_adv'));
        $mce_buttons = implode($mce_buttons, ',');
        $mce_buttons_2 = apply_filters('mce_buttons_2', array('formatselect', 'underline', 'justifyfull', 'forecolor', '|', 'pastetext', 'pasteword', 'removeformat', '|', 'media', 'charmap', '|', 'outdent', 'indent', '|', 'undo', 'redo', 'wp_help'));
        $mce_buttons_2 = implode($mce_buttons_2, ',');
        $mce_buttons_3 = apply_filters('mce_buttons_3', array());
        $mce_buttons_3 = implode($mce_buttons_3, ',');
        $mce_buttons_4 = apply_filters('mce_buttons_4', array());
        $mce_buttons_4 = implode($mce_buttons_4, ',');
    }
    $no_captions = apply_filters('disable_captions', '') ? true : false;
    // TinyMCE init settings
    $initArray = array('mode' => 'none', 'onpageload' => 'switchEditors.edInit', 'width' => '100%', 'theme' => 'advanced', 'skin' => 'wp_theme', 'theme_advanced_buttons1' => "{$mce_buttons}", 'theme_advanced_buttons2' => "{$mce_buttons_2}", 'theme_advanced_buttons3' => "{$mce_buttons_3}", 'theme_advanced_buttons4' => "{$mce_buttons_4}", 'language' => "{$mce_locale}", 'spellchecker_languages' => "{$mce_spellchecker_languages}", 'theme_advanced_toolbar_location' => 'top', 'theme_advanced_toolbar_align' => 'left', 'theme_advanced_statusbar_location' => 'bottom', 'theme_advanced_resizing' => true, 'theme_advanced_resize_horizontal' => false, 'dialog_type' => 'modal', 'relative_urls' => false, 'remove_script_host' => false, 'convert_urls' => false, 'apply_source_formatting' => false, 'remove_linebreaks' => true, 'paste_convert_middot_lists' => true, 'paste_remove_spans' => true, 'paste_remove_styles' => true, 'gecko_spellcheck' => true, 'entities' => '38,amp,60,lt,62,gt', 'accessibility_focus' => true, 'tab_focus' => ':prev,:next', 'save_callback' => 'switchEditors.saveCallback', 'wpeditimage_disable_captions' => $no_captions, 'plugins' => "{$plugins}");
    $mce_css = trim(apply_filters('mce_css', ''), ' ,');
    if (!empty($mce_css)) {
        $initArray['content_css'] = "{$mce_css}";
    }
    // For people who really REALLY know what they're doing with TinyMCE
    // You can modify initArray to add, remove, change elements of the config before tinyMCE.init
    // Setting "valid_elements", "invalid_elements" and "extended_valid_elements" can be done through "tiny_mce_before_init".
    // Best is to use the default cleanup by not specifying valid_elements, as TinyMCE contains full set of XHTML 1.0.
    if ($teeny) {
        $initArray = apply_filters('teeny_mce_before_init', $initArray);
    } else {
        $initArray = apply_filters('tiny_mce_before_init', $initArray);
    }
    if (!isset($concatenate_scripts)) {
        script_concat_settings();
    }
    $language = $initArray['language'];
    $zip = $compress_scripts ? 1 : 0;
    $ver = apply_filters('tiny_mce_version', '3211');
    if ('en' != $language) {
        include_once ABSPATH . WPINC . '/js/tinymce/langs/wp-langs.php';
    }
    $mce_options = '';
    foreach ($initArray as $k => $v) {
        $mce_options .= $k . ':"' . $v . '", ';
    }
    $mce_options = rtrim(trim($mce_options), '\\n\\r,');
    ?>

<script type="text/javascript">
/* <![CDATA[ */
tinyMCEPreInit = {
	base : "<?php 
    echo $baseurl;
    ?>
",
	suffix : "",
	query : "ver=<?php 
    echo $ver;
    ?>
",
	mceInit : {<?php 
    echo $mce_options;
    ?>
},
	load_ext : function(url,lang){var sl=tinymce.ScriptLoader;sl.markDone(url+'/langs/'+lang+'.js');sl.markDone(url+'/langs/'+lang+'_dlg.js');}
};
开发者ID:schr,项目名称:wordpress,代码行数:67,代码来源:post.php

示例5: print_late_styles

/**
 * Prints the styles that were queued too late for the HTML head.
 *
 * @since 3.3.0
 *
 * @global WP_Styles $wp_styles
 * @global bool      $concatenate_scripts
 *
 * @return array|void
 */
function print_late_styles()
{
    global $wp_styles, $concatenate_scripts;
    if (!$wp_styles instanceof WP_Styles) {
        return;
    }
    script_concat_settings();
    $wp_styles->do_concat = $concatenate_scripts;
    $wp_styles->do_footer_items();
    /**
     * Filters whether to print the styles queued too late for the HTML head.
     *
     * @since 3.3.0
     *
     * @param bool $print Whether to print the 'late' styles. Default true.
     */
    if (apply_filters('print_late_styles', true)) {
        _print_styles();
    }
    $wp_styles->reset();
    return $wp_styles->done;
}
开发者ID:Garth619,项目名称:Femi9,代码行数:32,代码来源:script-loader.php

示例6: scripts_and_styles

 /**
  * Queues script files and styles if logged in user has any editable areas and current page is not in admin.
  * Hookable through action 'wa_fronted_scripts'
  */
 public function scripts_and_styles()
 {
     if (is_array(WA_Fronted::$options) && !empty(WA_Fronted::$options) && WA_Fronted::$options !== false) {
         global $post, $wp_version, $tinymce_version, $concatenate_scripts, $compress_scripts;
         if (!isset($concatenate_scripts)) {
             script_concat_settings();
         }
         require_once ABSPATH . '/wp-admin/includes/post.php';
         do_action('wa_fronted_before_scripts', WA_Fronted::$options);
         load_plugin_textdomain('wa-fronted', false, plugin_basename(dirname(__FILE__)) . '/languages');
         wp_enqueue_media(array('post' => $post));
         add_thickbox();
         wp_deregister_script('tinymce');
         wp_enqueue_script('tinymce', includes_url('js/tinymce') . '/wp-tinymce.php?c=1', array(), $tinymce_version, true);
         wp_enqueue_script('wplink');
         wp_localize_script('wplink', 'ajaxurl', admin_url('admin-ajax.php'));
         wp_enqueue_script('wp-lists');
         wp_localize_script('wp-lists', 'ajaxurl', admin_url('admin-ajax.php'));
         wp_enqueue_script('jquery-ui-core');
         wp_enqueue_script('jquery-ui-draggable');
         wp_enqueue_script('jquery-ui-droppable');
         wp_enqueue_script('jquery-ui-datepicker');
         wp_enqueue_script('jqueryui-timepicker-addon', plugins_url('/bower_components/jqueryui-timepicker-addon/dist/jquery-ui-timepicker-addon.min.js', __FILE__), array('jquery', 'jquery-ui-core', 'jquery-ui-datepicker'), '1.5.5', true);
         wp_enqueue_script('wa-fronted-scripts', plugins_url('/js/min/scripts.min.js', __FILE__), array('jquery', 'jquery-ui-core', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-datepicker', 'jqueryui-timepicker-addon', 'tinymce', 'wp-util', 'editor', 'wplink', 'wp-lists'), '0.1', true);
         wp_localize_script('wa-fronted-scripts', 'global_vars', array('wp_lang' => get_bloginfo('language'), 'i18n' => $this->get_js_i18n(), 'ajax_url' => admin_url('admin-ajax.php'), 'options' => json_encode(WA_Fronted::$options), 'image_sizes' => $this->get_image_sizes(), 'nonce' => wp_create_nonce('wa_fronted_save_nonce')));
         wp_enqueue_style('buttons');
         wp_enqueue_style('dashicons');
         wp_enqueue_style('open-sans');
         wp_enqueue_style('wa-fronted-timepicker-addon', plugins_url('/bower_components/jqueryui-timepicker-addon/dist/jquery-ui-timepicker-addon.min.css', __FILE__));
         wp_enqueue_style('wa-fronted-style', plugins_url('/css/style.css', __FILE__));
         do_action('wa_fronted_after_scripts', WA_Fronted::$options);
     }
 }
开发者ID:r-a-y,项目名称:wa-fronted,代码行数:37,代码来源:wa-fronted.php

示例7: print_footer_scripts

function print_footer_scripts()
{
    global $wp_scripts, $concatenate_scripts;
    if (!$wp_scripts instanceof WP_Scripts) {
        return array();
        // No need to run if not instantiated.
    }
    script_concat_settings();
    $wp_scripts->do_concat = $concatenate_scripts;
    $wp_scripts->do_footer_items();
    if (apply_filters('print_footer_scripts', true)) {
        _print_scripts();
    }
    $wp_scripts->reset();
    return $wp_scripts->done;
}
开发者ID:AppItNetwork,项目名称:yii2-wordpress-themes,代码行数:16,代码来源:script-loader.php

示例8: wp_enqueue_scripts

 public function wp_enqueue_scripts()
 {
     global $tinymce_version, $concatenate_scripts, $compress_scripts, $wp_version;
     // Concatenate Scripts
     if (!isset($concatenate_scripts)) {
         script_concat_settings();
     }
     // TinyMCE Compressed
     if ($compress_scripts && $concatenate_scripts && isset($_SERVER['HTTP_ACCEPT_ENCODING']) && stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false) {
         wp_enqueue_script('note-tinymce', includes_url('js/tinymce') . '/wp-tinymce.php?c=1', false, $tinymce_version, true);
     } else {
         wp_enqueue_script('note-tinymce', includes_url('js/tinymce') . '/tinymce.min.js', false, $tinymce_version, true);
         wp_enqueue_script('note-tinymce-compat3x', includes_url('js/tinymce') . '/plugins/compat3x/plugin.min.js', array('note-tinymce'), $tinymce_version, true);
     }
     // Localize the Note TinyMCE script information
     wp_localize_script('note-tinymce', 'note_tinymce', $this->note_tinymce_localize);
     // If less than WordPress 4.0
     if (version_compare($wp_version, '4.0', '<')) {
         // Load our version of 'wpview' plugin
         wp_enqueue_script('note-tinymce-wpview', Note::plugin_url() . '/assets/js/note-tinymce-view.js', array('note-tinymce'), Note::$version, true);
         // Load backwards compatibility 'lists' plugin
         wp_enqueue_script('note-tinymce-lists', Note::plugin_url() . '/assets/js/note-tinymce-lists.js', array('note-tinymce'), Note::$version, true);
     }
     // Note TinyMCE Insert Plugin
     wp_enqueue_script('note-tinymce-insert', Note::plugin_url() . '/assets/js/note-tinymce-insert.js', array('note-tinymce'), Note::$version, true);
     // Note TinyMCE Image Plugin
     wp_enqueue_script('note-tinymce-image', Note::plugin_url() . '/assets/js/note-tinymce-image.js', array('note-tinymce'), Note::$version, true);
     // Note TinyMCE Theme
     wp_enqueue_script('note-tinymce-theme', Note::plugin_url() . '/assets/js/note-tinymce-theme.js', array('note-tinymce'), Note::$version, true);
     // Note Core
     wp_enqueue_script('note', Note::plugin_url() . '/assets/js/note.js', array('note-tinymce', 'wp-util', 'editor', 'wp-lists', 'customize-preview-widgets', 'jquery-ui-core', 'underscore'), Note::$version, true);
     wp_localize_script('note', 'note', $this->note_localize);
     // WordPress Lists
     wp_enqueue_script('wp-lists');
     wp_localize_script('wp-lists', 'ajaxurl', admin_url('admin-ajax.php'));
     // WordPress Links
     wp_enqueue_script('wplink');
     wp_localize_script('wplink', 'ajaxurl', admin_url('admin-ajax.php'));
     // WordPress Core/Modal Styles
     wp_enqueue_style('wp-core-ui', Note::plugin_url() . '/assets/css/wp-core-ui.css', false, Note::$version);
     wp_enqueue_style('buttons');
     wp_enqueue_style('note-modal', Note::plugin_url() . '/assets/css/modal.css', false, Note::$version);
     wp_enqueue_style('note-link-modal', Note::plugin_url() . '/assets/css/link-modal.css', false, Note::$version);
     // WordPress Media (has to come after WordPress Core/Modal Styles)
     wp_enqueue_media();
     // TinyMCE Core CSS
     wp_enqueue_style('tinymce-core', Note::plugin_url() . '/assets/css/tinymce-core.css', false, Note::$version);
     // TinyMCE View CSS
     wp_enqueue_style('tinymce-view', Note::plugin_url() . '/assets/css/tinymce-view.css', false, Note::$version);
     // Note Theme CSS
     wp_enqueue_style('note', Note::plugin_url() . '/assets/css/note.css', false, Note::$version);
     // Dashicons
     wp_enqueue_style('dashicons');
 }
开发者ID:se7ven214,项目名称:Kungfuphp.local,代码行数:54,代码来源:class-note-customizer.php

示例9: wp_enqueue_scripts

 function wp_enqueue_scripts()
 {
     global $post, $wp_version, $tinymce_version, $concatenate_scripts, $compress_scripts;
     if (!isset($concatenate_scripts)) {
         script_concat_settings();
     }
     $compressed = $compress_scripts && $concatenate_scripts && isset($_SERVER['HTTP_ACCEPT_ENCODING']) && false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip');
     $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG || file_exists(dirname(__FILE__) . '/.gitignore') ? '' : '.min';
     if ($this->has_fee()) {
         wp_enqueue_style('wp-core-ui', $this->url('/css/wp-core-ui.css'), false, self::VERSION, 'screen');
         wp_enqueue_style('wp-core-ui-colors', $this->url('/css/wp-core-ui-colors.css'), false, self::VERSION, 'screen');
         wp_enqueue_style('buttons');
         wp_enqueue_style('wp-auth-check');
         wp_enqueue_script('wp-auth-check');
         wp_enqueue_script('autosave-custom', $this->url('/js/autosave' . $suffix . '.js'), array('schedule', 'wp-ajax-response', 'fee'), self::VERSION, true);
         wp_localize_script('autosave-custom', 'autosaveL10n', array('autosaveInterval' => AUTOSAVE_INTERVAL, 'blog_id' => get_current_blog_id()));
         // Load tinymce.js when running from /src, else load wp-tinymce.js.gz (production) or tinymce.min.js (SCRIPT_DEBUG)
         $mce_suffix = false !== strpos($wp_version, '-src') ? '' : '.min';
         if ($compressed) {
             wp_enqueue_script('fee-tinymce', includes_url('js/tinymce') . '/wp-tinymce.php?c=1', array(), $tinymce_version, true);
         } else {
             wp_enqueue_script('fee-tinymce', includes_url('js/tinymce') . '/tinymce' . $mce_suffix . '.js', array(), $tinymce_version, true);
             wp_enqueue_script('fee-tinymce-compat3x', includes_url('js/tinymce') . '/plugins/compat3x/plugin' . $suffix . '.js', array('fee-tinymce'), $tinymce_version, true);
         }
         if (empty($suffix)) {
             wp_enqueue_script('fee-tinymce-image', $this->url('/js/tinymce.image.js'), array('fee-tinymce'), self::VERSION, true);
             wp_enqueue_script('fee-tinymce-insert', $this->url('/js/tinymce.insert.js'), array('fee-tinymce'), self::VERSION, true);
             wp_enqueue_script('fee-tinymce-markdown', $this->url('/js/tinymce.markdown.js'), array('fee-tinymce'), self::VERSION, true);
             wp_enqueue_script('fee-tinymce-more', $this->url('/js/tinymce.more.js'), array('fee-tinymce'), self::VERSION, true);
             wp_enqueue_script('fee-tinymce-view', $this->url('/js/tinymce.view.js'), array('fee-tinymce'), self::VERSION, true);
             wp_enqueue_script('fee-tinymce-theme', $this->url('/js/tinymce.theme.js'), array('fee-tinymce'), self::VERSION, true);
         } else {
             wp_enqueue_script('fee-tinymce-plugins', $this->url('/js/tinymce.min.js'), array('fee-tinymce'), self::VERSION, true);
         }
         $tinymce_plugins = array('feeImage', 'feeMarkDown', 'wpmore', 'wplink', 'wpview', 'paste', 'insert', 'hr', 'lists');
         $tinymce_toolbar = array('bold', 'italic', 'strikethrough', 'link', 'unlink', 'blockquote', 'h2', 'h3');
         $tinymce_blocks = array('wp_image', 'wp_gallery', 'wp_audio', 'wp_audio_playlist', 'wp_video', 'wp_video_playlist', 'hr', 'wp_more', 'wp_page');
         $tinymce = array('selector' => '#fee-mce-' . $post->ID, 'plugins' => implode(' ', array_unique(apply_filters('fee_tinymce_plugins', $tinymce_plugins))), 'toolbar' => apply_filters('fee_tinymce_toolbar', $tinymce_toolbar), 'blocks' => apply_filters('fee_tinymce_blocks', $tinymce_blocks), 'theme' => 'fee', 'inline' => true, 'relative_urls' => false, 'convert_urls' => false, 'browser_spellcheck' => true, 'placeholder' => apply_filters('fee_content_placeholder', __('Just write&hellip;')), 'wpeditimage_html5_captions' => current_theme_supports('html5', 'caption'));
         wp_enqueue_script('wp-lists');
         wp_localize_script('wp-lists', 'ajaxurl', admin_url('admin-ajax.php'));
         wp_enqueue_script('fee', $this->url('/js/fee' . $suffix . '.js'), array('fee-tinymce', 'wp-util', 'heartbeat', 'editor', 'wp-lists'), self::VERSION, true);
         wp_localize_script('fee', 'fee', array('tinymce' => apply_filters('fee_tinymce_config', $tinymce), 'postOnServer' => $post, 'permalink' => $this->get_sample_permalink($post->ID), 'nonces' => array('post' => wp_create_nonce('update-post_' . $post->ID), 'slug' => wp_create_nonce('slug-nonce_' . $post->ID), 'categories' => wp_create_nonce('fee-categories_' . $post->ID)), 'lock' => !wp_check_post_lock($post->ID) ? implode(':', wp_set_post_lock($post->ID)) : false, 'notices' => array('autosave' => $this->get_autosave_notice()), 'postTaxOnServer' => $this->get_post_tax_and_terms(), 'taxonomies' => $this->get_tax_and_terms()));
         wp_localize_script('fee', 'feeL10n', array('saveAlert' => __('The changes you made will be lost if you navigate away from this page.'), 'title' => apply_filters('fee_title_placeholder', __('Title'))));
         wp_enqueue_media(array('post' => $post));
         wp_deregister_script('mce-view');
         wp_enqueue_script('mce-view', $this->url('/js/mce-view' . $suffix . '.js'), array('shortcode', 'media-models', 'media-audiovideo', 'wp-playlist'), self::VERSION, true);
         wp_enqueue_script('wplink');
         wp_localize_script('wplink', 'ajaxurl', admin_url('admin-ajax.php'));
         wp_enqueue_script('fee-modal', $this->url('/js/modal' . $suffix . '.js'), array('jquery'), self::VERSION, true);
         wp_enqueue_style('fee-modal', $this->url('/css/modal.css'), false, self::VERSION, 'screen');
         wp_enqueue_style('fee-link-modal', $this->url('/css/link-modal.css'), false, self::VERSION, 'screen');
         wp_enqueue_style('tinymce-core', $this->url('/css/tinymce.core.css'), false, self::VERSION, 'screen');
         wp_enqueue_style('tinymce-view', $this->url('/css/tinymce.view.css'), false, self::VERSION, 'screen');
         wp_enqueue_style('fee', $this->url('/css/fee.css'), false, self::VERSION, 'screen');
         wp_enqueue_style('dashicons');
     }
     if (current_user_can('edit_posts')) {
         if (is_singular()) {
             require_once ABSPATH . '/wp-admin/includes/post.php';
             $user_id = wp_check_post_lock($post->ID);
             $user = get_userdata($user_id);
         }
         wp_enqueue_style('fee-adminbar', $this->url('/css/fee-adminbar.css'), false, self::VERSION, 'screen');
         wp_enqueue_script('fee-adminbar', $this->url('/js/fee-adminbar' . $suffix . '.js'), array('wp-util'), self::VERSION, true);
         wp_localize_script('fee-adminbar', 'fee', array('lock' => is_singular() && $user_id ? $user->display_name : false, 'supportedPostTypes' => $this->get_supported_post_types(), 'postNew' => admin_url('post-new.php'), 'nonce' => wp_create_nonce('fee-new')));
     }
 }
开发者ID:foxpcteam,项目名称:wp-front-end-editor,代码行数:67,代码来源:class-fee.php

示例10: initTinyMCE

    function initTinyMCE()
    {
        global $concatenate_scripts, $compress_scripts, $tinymce_version;
        if (!user_can_richedit()) {
            return;
        }
        $baseurl = includes_url('js/tinymce');
        $mce_locale = '' == get_locale() ? 'en' : strtolower(substr(get_locale(), 0, 2));
        // only ISO 639-1
        /*
        The following filter allows localization scripts to change the languages displayed in the spellchecker's drop-down menu.
        By default it uses Google's spellchecker API, but can be configured to use PSpell/ASpell if installed on the server.
        The + sign marks the default language. More information:
        http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker
        */
        $mce_spellchecker_languages = apply_filters('mce_spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv');
        $plugins = array('safari', 'inlinepopups', 'spellchecker', 'paste', 'wordpress', 'media', 'fullscreen', 'wpeditimage', 'wpgallery', 'tabfocus');
        $plugins = implode($plugins, ',');
        $mce_buttons = apply_filters('_mce_buttons', array('bold', 'italic', 'strikethrough', '|', 'bullist', 'numlist', 'blockquote', '|', 'link', 'unlink', 'code'));
        $mce_buttons = implode($mce_buttons, ',');
        $mce_buttons_2 = array();
        if (is_multisite()) {
            unset($mce_buttons_2[array_search('media', $mce_buttons_2)]);
        }
        $mce_buttons_2 = apply_filters('_mce_buttons_2', $mce_buttons_2);
        $mce_buttons_2 = implode($mce_buttons_2, ',');
        $mce_buttons_3 = apply_filters('_mce_buttons_3', array());
        $mce_buttons_3 = implode($mce_buttons_3, ',');
        $mce_buttons_4 = apply_filters('_mce_buttons_4', array());
        $mce_buttons_4 = implode($mce_buttons_4, ',');
        $no_captions = (bool) apply_filters('disable_captions', '');
        // TinyMCE init settings
        $initArray = array('mode' => 'specific_textareas', 'editor_selector' => 'lmceEditor', 'width' => '100%', 'theme' => 'advanced', 'skin' => 'wp_theme', 'theme_advanced_buttons1' => $mce_buttons, 'theme_advanced_buttons2' => $mce_buttons_2, 'theme_advanced_buttons3' => $mce_buttons_3, 'theme_advanced_buttons4' => $mce_buttons_4, 'language' => $mce_locale, 'spellchecker_languages' => $mce_spellchecker_languages, 'theme_advanced_toolbar_location' => 'top', 'theme_advanced_toolbar_align' => 'left', 'theme_advanced_resizing' => true, 'theme_advanced_resize_horizontal' => false, 'dialog_type' => 'modal', 'relative_urls' => false, 'remove_script_host' => false, 'convert_urls' => false, 'apply_source_formatting' => false, 'remove_linebreaks' => false, 'convert_newlines_to_brs' => true, 'gecko_spellcheck' => true, 'entities' => '38,amp,60,lt,62,gt', 'accessibility_focus' => true, 'tabfocus_elements' => 'major-publishing-actions', 'media_strict' => false, 'paste_remove_styles' => true, 'paste_remove_spans' => true, 'paste_strip_class_attributes' => 'all', 'wpeditimage_disable_captions' => $no_captions, 'plugins' => $plugins);
        if (empty($initArray['theme_advanced_buttons3']) && !empty($initArray['theme_advanced_buttons4'])) {
            $initArray['theme_advanced_buttons3'] = $initArray['theme_advanced_buttons4'];
            $initArray['theme_advanced_buttons4'] = '';
        }
        if (!isset($concatenate_scripts)) {
            script_concat_settings();
        }
        $language = $initArray['language'];
        $compressed = false;
        /**
         * Deprecated
         *
         * The tiny_mce_version filter is not needed since external plugins are loaded directly by TinyMCE.
         * These plugins can be refreshed by appending query string to the URL passed to mce_external_plugins filter.
         * If the plugin has a popup dialog, a query string can be added to the button action that opens it (in the plugin's code).
         */
        $version = apply_filters('tiny_mce_version', '');
        $version = 'ver=' . $tinymce_version . $version;
        if ('en' != $language) {
            include_once ABSPATH . WPINC . '/js/tinymce/langs/wp-langs.php';
        }
        $mce_options = '';
        foreach ($initArray as $k => $v) {
            $mce_options .= $k . ':"' . $v . '", ';
        }
        $mce_options = rtrim(trim($mce_options), '\\n\\r,');
        ?>
		<script type="text/javascript">
		/* <![CDATA[ */
		tinyMCEPreInit = {
			base : "<?php 
        echo $baseurl;
        ?>
",
			suffix : "",
			query : "<?php 
        echo $version;
        ?>
",
			mceInit : {<?php 
        echo $mce_options;
        ?>
},
			load_ext : function(url,lang) {var sl=tinymce.ScriptLoader;sl.markDone(url+'/langs/'+lang+'.js');sl.markDone(url+'/langs/'+lang+'_dlg.js');}
		};
		/* ]]> */
		</script>
		
		<?php 
        /*
        	if ( $compressed )
        		echo "<script type='text/javascript' src='$baseurl/wp-tinymce.php?c=1&amp;$version'></script>\n";
        	else
        		echo "<script type='text/javascript' src='$baseurl/tiny_mce.js?$version'></script>\n";
        	
        	if ( 'en' != $language && isset($lang) )
        		echo "<script type='text/javascript'>\n$lang\n</script>\n";
        	else
        		echo "<script type='text/javascript' src='$baseurl/langs/wp-langs-en.js?$version'></script>\n";
        */
        ?>
		
		<script type="text/javascript">
		/* <![CDATA[ */
		<?php 
        if ($ext_plugins) {
            echo "{$ext_plugins}\n";
//.........这里部分代码省略.........
开发者ID:herewithme,项目名称:simple-shortcodes-manager,代码行数:101,代码来源:class.admin.php

示例11: print_admin_styles

/**
 * Prints the styles queue in the HTML head on admin pages.
 *
 * @since 2.8.0
 */
function print_admin_styles()
{
    global $wp_styles, $concatenate_scripts, $compress_css;
    if (!is_a($wp_styles, 'WP_Styles')) {
        $wp_styles = new WP_Styles();
    }
    script_concat_settings();
    $wp_styles->do_concat = $concatenate_scripts;
    $zip = $compress_css ? 1 : 0;
    if ($zip && defined('ENFORCE_GZIP') && ENFORCE_GZIP) {
        $zip = 'gzip';
    }
    $wp_styles->do_items(false);
    /**
     * Filter whether to print the admin styles.
     *
     * @since 2.8.0
     *
     * @param bool $print Whether to print the admin styles. Default true.
     */
    if (apply_filters('print_admin_styles', true)) {
        _print_styles();
    }
    $wp_styles->reset();
    return $wp_styles->done;
}
开发者ID:stiyes,项目名称:ngionic,代码行数:31,代码来源:script-loader.php

示例12: wp_tiny_mce


//.........这里部分代码省略.........
                if (file_exists("{$template_dir}/{$file}")) {
                    $mce_css[] = "{$template_uri}/{$file}";
                }
                if (file_exists("{$style_dir}/{$file}")) {
                    $mce_css[] = "{$style_uri}/{$file}";
                }
            }
        }
        $mce_css = implode(',', $mce_css);
    } else {
        $mce_css = '';
    }
    $mce_css = trim(apply_filters('mce_css', $mce_css), ' ,');
    if (!empty($mce_css)) {
        $initArray['content_css'] = $mce_css;
    }
    if (is_array($settings)) {
        $initArray = array_merge($initArray, $settings);
    }
    // For people who really REALLY know what they're doing with TinyMCE
    // You can modify initArray to add, remove, change elements of the config before tinyMCE.init
    // Setting "valid_elements", "invalid_elements" and "extended_valid_elements" can be done through "tiny_mce_before_init".
    // Best is to use the default cleanup by not specifying valid_elements, as TinyMCE contains full set of XHTML 1.0.
    if ($teeny) {
        $initArray = apply_filters('teeny_mce_before_init', $initArray);
    } else {
        $initArray = apply_filters('tiny_mce_before_init', $initArray);
    }
    if (empty($initArray['theme_advanced_buttons3']) && !empty($initArray['theme_advanced_buttons4'])) {
        $initArray['theme_advanced_buttons3'] = $initArray['theme_advanced_buttons4'];
        $initArray['theme_advanced_buttons4'] = '';
    }
    if (!isset($concatenate_scripts)) {
        script_concat_settings();
    }
    $language = $initArray['language'];
    $compressed = $compress_scripts && $concatenate_scripts && isset($_SERVER['HTTP_ACCEPT_ENCODING']) && false !== strpos(strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip');
    /**
     * Deprecated
     *
     * The tiny_mce_version filter is not needed since external plugins are loaded directly by TinyMCE.
     * These plugins can be refreshed by appending query string to the URL passed to mce_external_plugins filter.
     * If the plugin has a popup dialog, a query string can be added to the button action that opens it (in the plugin's code).
     */
    $version = apply_filters('tiny_mce_version', '');
    $version = 'ver=' . $tinymce_version . $version;
    if ('en' != $language) {
        include_once ABSPATH . WPINC . '/js/tinymce/langs/wp-langs.php';
    }
    $mce_options = '';
    foreach ($initArray as $k => $v) {
        if (is_bool($v)) {
            $val = $v ? 'true' : 'false';
            $mce_options .= $k . ':' . $val . ', ';
            continue;
        } elseif (!empty($v) && is_string($v) && ('{' == $v[0] || '[' == $v[0])) {
            $mce_options .= $k . ':' . $v . ', ';
            continue;
        }
        $mce_options .= $k . ':"' . $v . '", ';
    }
    $mce_options = rtrim(trim($mce_options), '\\n\\r,');
    ?>

<script type="text/javascript">
/* <![CDATA[ */
开发者ID:ahsaeldin,项目名称:projects,代码行数:67,代码来源:post.php

示例13: editor_js

    public static function editor_js()
    {
        global $tinymce_version, $concatenate_scripts, $compress_scripts;
        /**
         * Filter "tiny_mce_version" is deprecated
         *
         * The tiny_mce_version filter is not needed since external plugins are loaded directly by TinyMCE.
         * These plugins can be refreshed by appending query string to the URL passed to "mce_external_plugins" filter.
         * If the plugin has a popup dialog, a query string can be added to the button action that opens it (in the plugin's code).
         */
        $version = 'ver=' . $tinymce_version;
        $tinyMceMajorVersion = substr($tinymce_version, 0, 1);
        $tmce_on = !empty(self::$mce_settings);
        if (!isset($concatenate_scripts)) {
            script_concat_settings();
        }
        $compressed = $compress_scripts && $concatenate_scripts && isset($_SERVER['HTTP_ACCEPT_ENCODING']) && false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip');
        if ($tinyMceMajorVersion < 4 && $tmce_on && 'en' != self::$mce_locale) {
            include_once ABSPATH . WPINC . '/js/tinymce/langs/wp-langs.php';
        }
        $mceInit = $qtInit = '';
        if ($tmce_on) {
            foreach (self::$mce_settings as $editor_id => $init) {
                $options = self::_parse_init($init);
                $mceInit .= "'{$editor_id}':{$options},";
            }
            $mceInit = '{' . trim($mceInit, ',') . '}';
        } else {
            $mceInit = '{}';
        }
        if (!empty(self::$qt_settings)) {
            foreach (self::$qt_settings as $editor_id => $init) {
                $options = self::_parse_init($init);
                $qtInit .= "'{$editor_id}':{$options},";
            }
            $qtInit = '{' . trim($qtInit, ',') . '}';
        } else {
            $qtInit = '{}';
        }
        $ref = array('plugins' => implode(',', self::$plugins), 'theme' => 'advanced', 'language' => self::$mce_locale);
        do_action('before_wp_tiny_mce', self::$mce_settings);
        ?>

        <script type="text/javascript">
            tinyMCEPreInit = {
                base : "<?php 
        echo self::$baseurl;
        ?>
",
                suffix : "",
                query : "<?php 
        echo $version;
        ?>
",
                mceInit : <?php 
        echo $mceInit;
        ?>
,
                qtInit : <?php 
        echo $qtInit;
        ?>
,
                ref : <?php 
        echo self::_parse_init($ref);
        ?>
,
                load_ext : function(url,lang){var sl=tinymce.ScriptLoader;sl.markDone(url+'/langs/'+lang+'.js');sl.markDone(url+'/langs/'+lang+'_dlg.js');}
            };
        </script>
        <?php 
        $baseurl = self::$baseurl;
        if ($tmce_on) {
            if ($compressed) {
                echo "<script type='text/javascript' src='{$baseurl}/wp-tinymce.php?c=1&amp;{$version}'></script>\n";
                //wp_enqueue_script(OP_SN.'-wp-tinymce', $baseurl.'/wp-tinymce.php?c=1&amp;'.$version, array(OP_SN.'-noconflict-js'), OP_VERSION);
            } else {
                if ($tinyMceMajorVersion < 4) {
                    echo "<script type='text/javascript' src='{$baseurl}/tiny_mce.js?{$version}'></script>\n";
                } else {
                    echo "<script type='text/javascript' src='{$baseurl}/wp-tinymce.php?{$version}'></script>\n";
                }
                //$tiny_mce_url = $baseurl.'/tiny_mce.js?'.$version;
                //wp_enqueue_script(OP_SN.'-tiny_mce', $tiny_mce_url, false, OP_VERSION, true);
                //wp_print_scripts(OP_SN.'-tiny_mce');
            }
            if ($tinyMceMajorVersion < 4) {
                echo "<script type='text/javascript' src='{$baseurl}/langs/wp-langs-en.js?{$version}'></script>\n";
            } else {
                echo "<script type='text/javascript'>\n" . self::wp_mce_translation() . "</script>\n";
                if (self::$ext_plugins) {
                    // Load the old-format English strings to prevent unsightly labels in old style popups
                    echo "<script type='text/javascript' src='{$baseurl}/langs/wp-langs-en.js?{$version}'></script>\n";
                }
            }
        }
        ?>

    <script type="text/javascript">
        (function($){

//.........这里部分代码省略.........
开发者ID:denis-chmel,项目名称:wordpress,代码行数:101,代码来源:tinymce.php

示例14: editor_js

    function editor_js()
    {
        global $tinymce_version, $concatenate_scripts, $compress_scripts;
        /**
         * Filter "tiny_mce_version" is deprecated
         *
         * The tiny_mce_version filter is not needed since external plugins are loaded directly by TinyMCE.
         * These plugins can be refreshed by appending query string to the URL passed to "mce_external_plugins" filter.
         * If the plugin has a popup dialog, a query string can be added to the button action that opens it (in the plugin's code).
         */
        $version = 'ver=' . $tinymce_version;
        $tmce_on = !empty($this->mce_settings);
        if (!isset($concatenate_scripts)) {
            script_concat_settings();
        }
        $compressed = $compress_scripts && $concatenate_scripts && isset($_SERVER['HTTP_ACCEPT_ENCODING']) && false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip');
        if ($tmce_on && 'en' != $this->mce_locale) {
            include_once ABSPATH . WPINC . '/js/tinymce/langs/wp-langs.php';
        }
        $mceInit = $qtInit = '';
        if ($tmce_on) {
            foreach ($this->mce_settings as $editor_id => $init) {
                $options = $this->_parse_init($init);
                $mceInit .= "'{$editor_id}':{$options},\n";
            }
            $mceInit = '{' . trim($mceInit, '\\n,') . '}';
        } else {
            $mceInit = '{}';
        }
        if (!empty($this->qt_settings)) {
            foreach ($this->qt_settings as $editor_id => $init) {
                $options = $this->_parse_init($init);
                $qtInit .= "'{$editor_id}':{$options},\n";
            }
            $qtInit = '{' . trim($qtInit, '\\n,') . '}';
        } else {
            $qtInit = '{}';
        }
        $ref = array('plugins' => implode(',', $this->plugins), 'theme' => 'advanced', 'language' => $this->mce_locale);
        do_action('before_wp_tiny_mce', $this->mce_settings);
        ?>

	<script type="text/javascript">
		tinyMCEPreInit = {
			base : "<?php 
        echo $this->baseurl;
        ?>
",
			suffix : "",
			query : "<?php 
        echo $version;
        ?>
",
			mceInit : <?php 
        echo $mceInit;
        ?>
,
			qtInit : <?php 
        echo $qtInit;
        ?>
,
			ref : <?php 
        echo $this->_parse_init($ref);
        ?>
,
			load_ext : function(url,lang){var sl=tinymce.ScriptLoader;sl.markDone(url+'/langs/'+lang+'.js');sl.markDone(url+'/langs/'+lang+'_dlg.js');}
		};
	</script>
<?php 
        if ($tmce_on) {
            if ($compressed) {
                echo "<script type='text/javascript' src='{$this->baseurl}/wp-tinymce.php?c=1&amp;{$version}'></script>\n";
            } else {
                echo "<script type='text/javascript' src='{$this->baseurl}/tiny_mce.js?{$version}'></script>\n";
            }
            if ('en' != $this->mce_locale && isset($lang)) {
                echo "<script type='text/javascript'>\n{$lang}\n</script>\n";
            } else {
                echo "<script type='text/javascript' src='{$this->baseurl}/langs/wp-langs-en.js?{$version}'></script>\n";
            }
        }
        ?>

	<script type="text/javascript">
		(function(){
			var init, ed, qt, first_init, mce = <?php 
        echo $this->default_editor == 'tinymce' ? 'true' : 'false';
        ?>
;

			if ( typeof(tinymce) == 'object' ) {
				for ( ed in tinyMCEPreInit.mceInit ) {
					if ( first_init ) {
						init = tinyMCEPreInit.mceInit[ed] = tinymce.extend( {}, first_init, tinyMCEPreInit.mceInit[ed] );
					} else {
						init = first_init = tinyMCEPreInit.mceInit[ed];
					}

					if ( mce )
						try { tinymce.init(init); } catch(e){}
//.........这里部分代码省略.........
开发者ID:netconstructor,项目名称:WordPress,代码行数:101,代码来源:class-wp-editor.php

示例15: print_admin_styles

/**
 * Prints the styles queue in the HTML head on admin pages.
 *
 * @since 2.8.0
 *
 * @global bool $concatenate_scripts
 *
 * @return array
 */
function print_admin_styles()
{
    global $concatenate_scripts;
    $wp_styles = wp_styles();
    script_concat_settings();
    $wp_styles->do_concat = $concatenate_scripts;
    $wp_styles->do_items(false);
    /**
     * Filter whether to print the admin styles.
     *
     * @since 2.8.0
     *
     * @param bool $print Whether to print the admin styles. Default true.
     */
    if (apply_filters('print_admin_styles', true)) {
        _print_styles();
    }
    $wp_styles->reset();
    return $wp_styles->done;
}
开发者ID:vheidari,项目名称:WordPress,代码行数:29,代码来源:script-loader.php


注:本文中的script_concat_settings函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。