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


PHP get_editor_stylesheets函数代码示例

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


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

示例1: editor_settings


//.........这里部分代码省略.........
                             if (@is_file($path . $mce_locale . '_dlg.js')) {
                                 $strings .= @file_get_contents($path . $mce_locale . '_dlg.js') . "\n";
                             }
                             if ('en' != $mce_locale && empty($strings)) {
                                 if (@is_file($path . 'en.js')) {
                                     $str1 = @file_get_contents($path . 'en.js');
                                     $strings .= preg_replace('/([\'"])en\\./', '$1' . $mce_locale . '.', $str1, 1) . "\n";
                                 }
                                 if (@is_file($path . 'en_dlg.js')) {
                                     $str2 = @file_get_contents($path . 'en_dlg.js');
                                     $strings .= preg_replace('/([\'"])en\\./', '$1' . $mce_locale . '.', $str2, 1) . "\n";
                                 }
                             }
                             if (!empty($strings)) {
                                 $ext_plugins .= "\n" . $strings . "\n";
                             }
                         }
                         $ext_plugins .= 'tinyMCEPreInit.load_ext("' . $plugurl . '", "' . $mce_locale . '");' . "\n";
                         $ext_plugins .= 'tinymce.PluginManager.load("' . $name . '", "' . $url . '");' . "\n";
                     }
                 }
             }
             self::$plugins = $plugins;
             self::$ext_plugins = $ext_plugins;
             self::$first_init = array('theme' => 'modern', 'skin' => 'lightgray', 'language' => self::$mce_locale, 'formats' => '{' . 'alignleft: [' . '{selector: "p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li", styles: {textAlign:"left"}},' . '{selector: "img,table,dl.wp-caption", classes: "alignleft"}' . '],' . 'aligncenter: [' . '{selector: "p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li", styles: {textAlign:"center"}},' . '{selector: "img,table,dl.wp-caption", classes: "aligncenter"}' . '],' . 'alignright: [' . '{selector: "p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li", styles: {textAlign:"right"}},' . '{selector: "img,table,dl.wp-caption", classes: "alignright"}' . '],' . 'strikethrough: {inline: "del"}' . '}', 'relative_urls' => false, 'remove_script_host' => false, 'convert_urls' => false, 'browser_spellcheck' => true, 'fix_list_elements' => true, 'entities' => '38,amp,60,lt,62,gt', 'entity_encoding' => 'raw', 'keep_styles' => false, 'cache_suffix' => 'wp-mce-' . $tinymce_version, 'preview_styles' => 'font-family font-size font-weight font-style text-decoration text-transform', 'end_container_on_empty_block' => true, 'wpeditimage_disable_captions' => $no_captions, 'wpeditimage_html5_captions' => current_theme_supports('html5', 'caption'), 'plugins' => implode(',', $plugins), 'wp_lang_attr' => get_bloginfo('language'));
             if (!empty($mce_external_plugins)) {
                 self::$first_init['external_plugins'] = wp_json_encode($mce_external_plugins);
             }
             $suffix = SCRIPT_DEBUG ? '' : '.min';
             $version = 'ver=' . $wp_version;
             $dashicons = includes_url("css/dashicons{$suffix}.css?{$version}");
             // WordPress default stylesheet and dashicons
             $mce_css = array($dashicons, self::$baseurl . '/skins/wordpress/wp-content.css?' . $version);
             $editor_styles = get_editor_stylesheets();
             if (!empty($editor_styles)) {
                 foreach ($editor_styles as $style) {
                     $mce_css[] = $style;
                 }
             }
             /**
              * Filters the comma-delimited list of stylesheets to load in TinyMCE.
              *
              * @since 2.1.0
              *
              * @param string $stylesheets Comma-delimited list of stylesheets.
              */
             $mce_css = trim(apply_filters('mce_css', implode(',', $mce_css)), ' ,');
             if (!empty($mce_css)) {
                 self::$first_init['content_css'] = $mce_css;
             }
         }
         if ($set['teeny']) {
             /**
              * Filters the list of teenyMCE buttons (Text tab).
              *
              * @since 2.7.0
              *
              * @param array  $buttons   An array of teenyMCE buttons.
              * @param string $editor_id Unique editor identifier, e.g. 'content'.
              */
             $mce_buttons = apply_filters('teeny_mce_buttons', array('bold', 'italic', 'underline', 'blockquote', 'strikethrough', 'bullist', 'numlist', 'alignleft', 'aligncenter', 'alignright', 'undo', 'redo', 'link', 'unlink', 'fullscreen'), $editor_id);
             $mce_buttons_2 = $mce_buttons_3 = $mce_buttons_4 = array();
         } else {
             $mce_buttons = array('bold', 'italic', 'strikethrough', 'bullist', 'numlist', 'blockquote', 'hr', 'alignleft', 'aligncenter', 'alignright', 'link', 'unlink', 'wp_more', 'spellchecker');
             if (!wp_is_mobile()) {
                 if ($set['_content_editor_dfw']) {
开发者ID:BoldGrid,项目名称:WordPress,代码行数:67,代码来源:class-wp-editor.php

示例2: has_editor_style

 private function has_editor_style()
 {
     if (!current_theme_supports('editor-style')) {
         return 'not-supporetd';
     }
     $editor_stylesheets = get_editor_stylesheets();
     if (is_array($editor_stylesheets)) {
         foreach ($editor_stylesheets as $url) {
             if (strpos($url, 'editor-style.css') !== false) {
                 return 'present';
             }
         }
     }
     return 'not-present';
 }
开发者ID:tleonard2,项目名称:durablegbFeb,代码行数:15,代码来源:tinymce-advanced.php

示例3: remove_theme_css

 /**
  * remove_theme_css
  * Remove the editor css from editors that aren't for post content.
  *
  * @param array $mceInit The tinymce init object.
  * @param string $editor_id The editor id.
  * 
  * @return array The tinymce init object.
  *
  * @access public
  * @static
  * @since 1.0
  */
 public static function remove_theme_css($mceInit, $editor_id)
 {
     $prefix = piklist::$prefix . 'post_post_content';
     if ($editor_id != 'content' && substr($editor_id, 0, strlen($prefix)) !== $prefix) {
         $stylesheets = get_editor_stylesheets();
         $content_css = explode(',', $mceInit['content_css']);
         $content_css = array_diff($content_css, $stylesheets);
         array_push($content_css, piklist::$add_ons['piklist']['url'] . '/parts/css/tinymce-piklist.css');
         $mceInit['content_css'] = implode(',', $content_css);
     }
     return $mceInit;
 }
开发者ID:a42,项目名称:piklist,代码行数:25,代码来源:class-piklist-form.php

示例4: admin_footer

    /**
     * Generate javascript for the copying to the template.
     *
     * @param  none
     * @return none
     */
    public function admin_footer()
    {
        global $hook_suffix;
        if ('post-new.php' === $hook_suffix) {
            if (get_post_type() === $this->post_type) {
                if (isset($_GET['origin']) && intval($_GET['origin'])) {
                    $origin = get_post(intval($_GET['origin']));
                    if ($origin) {
                        $template = array('post_title' => $origin->post_title, 'post_content' => wpautop($origin->post_content));
                        ?>
						<script type="text/javascript">
						var origin = <?php 
                        echo json_encode($template);
                        ?>
;
						jQuery( '#title').val(origin.post_title );
						jQuery( '#content').val(origin.post_content );
						</script>
						<?php 
                    }
                }
            }
        }
        ?>
		<div id="tinymce-templates-backdrop" style="desplay: none;"></div>
		<div id="tinymce-templates-wrap" class="wp-core-ui search-panel-visible" style="desplay: none;">
			<div class="modal">
				<div class="header">
					<h1><span class="dashicons dashicons-edit"></span> <?php 
        _e('Insert Template', 'tinymce_templates');
        ?>
</h1>
					<a href="#" class="close"><span class="dashicons dashicons-no-alt"></span></a>
				</div>
				<div class="container">
					<select id="tinymce-templates-list"></select>
					<iframe id="tinymce-templates-preview"></iframe>
				</div>
				<div class="footer">
					<div id="tinymce-templates-message"><?php 
        _e('Note: The template will be inserted as shortcode.', 'tinymce_templates');
        ?>
</div>
					<a href="#" id="tinymce-templates-insert" class="button button-primary button-large template-button-insert" disabled><?php 
        _e('Insert Template', 'tinymce_templates');
        ?>
</a>
				</div>
			</div>
		</div>
		<?php 
        $url = admin_url('admin-ajax.php');
        $nonce = wp_create_nonce('tinymce_templates');
        $args = array('action' => 'tinymce_templates', 'nonce' => $nonce);
        ?>
		<script type="text/javascript">
			var tinymce_templates_list_uri = '<?php 
        echo esc_url($url);
        ?>
';
			var tinymce_templates_list_args = <?php 
        echo json_encode($args);
        ?>
;
			var tinymce_templates_editor_stylesheets = <?php 
        echo json_encode(get_editor_stylesheets());
        ?>
;
		</script>
		<?php 
    }
开发者ID:924ge,项目名称:UPC,代码行数:77,代码来源:tinymce-templates.php

示例5: print_window_js_var


//.........这里部分代码省略.........
                    foreach ($mce_external_languages as $name => $path) {
                        if (@is_file($path) && @is_readable($path)) {
                            include_once $path;
                            $ext_plugins .= $strings . "\n";
                            $loaded_langs[] = $name;
                        }
                    }
                }
                foreach ($mce_external_plugins as $name => $url) {
                    if (in_array($name, $plugins, true)) {
                        unset($mce_external_plugins[$name]);
                        continue;
                    }
                    $url = set_url_scheme($url);
                    $mce_external_plugins[$name] = $url;
                    $plugurl = dirname($url);
                    $strings = '';
                    // Try to load langs/[locale].js and langs/[locale]_dlg.js
                    if (!in_array($name, $loaded_langs, true)) {
                        $path = str_replace(content_url(), '', $plugurl);
                        $path = WP_CONTENT_DIR . $path . '/langs/';
                        if (function_exists('realpath')) {
                            $path = trailingslashit(realpath($path));
                        }
                        if (@is_file($path . $mce_locale . '.js')) {
                            $strings .= @file_get_contents($path . $mce_locale . '.js') . "\n";
                        }
                        if (@is_file($path . $mce_locale . '_dlg.js')) {
                            $strings .= @file_get_contents($path . $mce_locale . '_dlg.js') . "\n";
                        }
                        if ('en' != $mce_locale && empty($strings)) {
                            if (@is_file($path . 'en.js')) {
                                $str1 = @file_get_contents($path . 'en.js');
                                $strings .= preg_replace('/([\'"])en\\./', '$1' . $mce_locale . '.', $str1, 1) . "\n";
                            }
                            if (@is_file($path . 'en_dlg.js')) {
                                $str2 = @file_get_contents($path . 'en_dlg.js');
                                $strings .= preg_replace('/([\'"])en\\./', '$1' . $mce_locale . '.', $str2, 1) . "\n";
                            }
                        }
                        if (!empty($strings)) {
                            $ext_plugins .= "\n" . $strings . "\n";
                        }
                    }
                    $ext_plugins .= 'tinymce.PluginManager.load("' . $name . '", "' . $url . '");' . "\n";
                }
            }
            // WordPress default stylesheet and dashicons
            $mce_css = array(includes_url("css/dashicons.min.css"), includes_url('js/tinymce') . '/skins/wordpress/wp-content.css?' . $version);
            $editor_styles = get_editor_stylesheets();
            if (!empty($editor_styles)) {
                foreach ($editor_styles as $style) {
                    $mce_css[] = $style;
                }
            }
            /**
             * Filter the comma-delimited list of stylesheets to load in TinyMCE.
             *
             * @since 2.1.0
             *
             * @param string $stylesheets Comma-delimited list of stylesheets.
             */
            $mce_css = trim(apply_filters('mce_css', implode(',', $mce_css)), ' ,');
            ?>
        <script type="text/javascript">
            window.ctf_teeny_mce_buttons = "<?php 
            echo implode(',', $ctf_teeny_mce_buttons);
            ?>
";
            window.ctf_mce_buttons = "<?php 
            echo implode(',', $mce_buttons);
            ?>
";
            window.ctf_mce_buttons_2 = "<?php 
            echo implode(',', $mce_buttons_2);
            ?>
";
            window.ctf_mce_buttons_3 = "<?php 
            echo implode(',', $mce_buttons_3);
            ?>
";
            window.ctf_mce_buttons_4 = "<?php 
            echo implode(',', $mce_buttons_4);
            ?>
";
            window.ctf_plugins = "<?php 
            echo implode(',', $plugins);
            ?>
";
            window.ctf_mce_css = "<?php 
            echo $mce_css;
            ?>
";
            window.ctf_mce_external_plugins = <?php 
            echo json_encode($mce_external_plugins);
            ?>
;
    	</script>
        <?php 
        }
开发者ID:CantoThemes,项目名称:CantoFramework,代码行数:101,代码来源:cantoframework.php


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