get_editor_stylesheets()

Retrieve any registered editor stylesheets

描述

返回值

(array) If registered, a list of editor stylesheet URLs.

源代码

File: wp-includes/theme.php

function get_editor_stylesheets() {

$stylesheets = array();

// load editor_style.css if the current theme supports it

if ( ! empty( $GLOBALS['editor_styles'] ) && is_array( $GLOBALS['editor_styles'] ) ) {

$editor_styles = $GLOBALS['editor_styles'];

$editor_styles = array_unique( array_filter( $editor_styles ) );

$style_uri = get_stylesheet_directory_uri();

$style_dir = get_stylesheet_directory();

// Support externally referenced styles (like, say, fonts).

foreach ( $editor_styles as $key => $file ) {

if ( preg_match( '~^(https?:)?//~', $file ) ) {

$stylesheets[] = esc_url_raw( $file );

unset( $editor_styles[ $key ] );

}

}

// Look in a parent theme first, that way child theme CSS overrides.

if ( is_child_theme() ) {

$template_uri = get_template_directory_uri();

$template_dir = get_template_directory();

foreach ( $editor_styles as $key => $file ) {

if ( $file && file_exists( "$template_dir/$file" ) ) {

$stylesheets[] = "$template_uri/$file";

}

}

}

foreach ( $editor_styles as $file ) {

if ( $file && file_exists( "$style_dir/$file" ) ) {

$stylesheets[] = "$style_uri/$file";

}

}

}

/**

* Filters the array of stylesheets applied to the editor.

*

* @since 4.3.0

*

* @param array $stylesheets Array of stylesheets to be applied to the editor.

*/

return apply_filters( 'editor_stylesheets', $stylesheets );

}

更新日志

Version

描述

4.0.0

Introduced.

相关函数

Uses

wp-includes/theme.php:

editor_stylesheets

wp-includes/theme.php:

get_stylesheet_directory_uri()

wp-includes/theme.php:

get_stylesheet_directory()

wp-includes/theme.php:

get_template_directory_uri()

wp-includes/theme.php:

get_template_directory()

wp-includes/theme.php:

is_child_theme()

wp-includes/formatting.php:

esc_url_raw()

wp-includes/plugin.php:

apply_filters()

Show 3 more uses

Used By

wp-includes/class-wp-editor.php:

_WP_Editors::editor_settings()

php geteditor,wordpress函数get_editor_stylesheets()用法示例相关推荐

  1. php中mimes函数,wordpress函数check_upload_mimes()用法示例

    check_upload_mimes( array $mimes ) Check an array of MIME types against a whitelist. 描述 WordPress sh ...

  2. php getfooter,wordpress函数get_footer()用法示例

    get_footer( string $name = null ) Load footer template. 描述 Includes the footer template for a theme ...

  3. add php support,wordpress函数add_post_type_support()用法示例

    add_post_type_support( string $post_type, string|array $feature ) Register support of certain featur ...

  4. PHP Calendar 函数,wordpress函数get_calendar()用法示例

    get_calendar( bool $initial = true, bool $echo = true ) Display calendar with days that have posts a ...

  5. escilpe mysql,wordpress函数esc_sql()用法示例

    esc_sql( string|array $data ) Escapes data for use in a MySQL query. 描述 Usually you should prepare q ...

  6. php函数clean(),wordpress函数clean_url()用法示例

    Warning: This function has been deprecated. Use esc_url() instead. clean_url( string $url, array $pr ...

  7. ?php get_sidebar(); ?,wordpress函数get_sidebar()用法示例

    get_sidebar( string $name = null ) Load sidebar template. 描述 Includes the sidebar template for a the ...

  8. html class函数,wordpress函数sanitize_html_class()用法示例

    sanitize_html_class( string $class, string $fallback = '' ) Sanitizes an HTML classname to ensure it ...

  9. php theexcerpt,wordpress的excerpt()函数的用法示例

    本篇文章给大家带来的内容是关于wordpress的excerpt()函数的用法示例,有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助. 问题:在wordpres中的single页面,本身引 ...

最新文章

  1. spring事务-说说Propagation及其实现原理
  2. python常用数据结构
  3. 说实话,用完Gradle之后,有点嫌弃Maven了。贼好用!
  4. 执行计划生成及查看的几种方法
  5. RookeyFrame 隐藏 首次加载菜单 的伸缩动画
  6. 《python可以这样学》第一章
  7. 木兰宽松许可证(MulanPSL v2)解析
  8. 根据.jgwx配准文件绘制并加载图层
  9. 深度可分离卷积(Depthwise separable convolution)
  10. 电脑加域、exchange邮箱设置、绑定打印机
  11. Spring Cloud微服务实战
  12. Endnote 插入文献导致word崩溃!!解决方法
  13. 常用项目文档目录示例
  14. Ghelper安装及使用
  15. Kent Beck 教你编程模式与代码重构
  16. 小白刷LeeCode(算法篇)
  17. Android 音乐播放器SD卡本地播放器实现
  18. ubuntu 打印git邮箱_win 10配置Ubuntu子系统—可以考虑放弃VMware了
  19. containers详解
  20. Springboot拦截器实现IP黑名单

热门文章

  1. Smarty 入手学习教程
  2. 数据库(oracle) 索引
  3. Linux下实现Raid 5软阵列
  4. lambda表达式对list排序
  5. 1.1方程求根之二分法
  6. 01 前端HTTP协议(图解HTTP) 之 网络基础
  7. 总结:Linux磁盘分区管理
  8. c#devexpres窗体划分 以及panelcontrol 相关操作
  9. windows多线程同步互斥--总结
  10. 软考倒计时7天:题目书中的易混点