php geteditor,wordpress函数get_editor_stylesheets()用法示例
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()用法示例相关推荐
- php中mimes函数,wordpress函数check_upload_mimes()用法示例
check_upload_mimes( array $mimes ) Check an array of MIME types against a whitelist. 描述 WordPress sh ...
- php getfooter,wordpress函数get_footer()用法示例
get_footer( string $name = null ) Load footer template. 描述 Includes the footer template for a theme ...
- add php support,wordpress函数add_post_type_support()用法示例
add_post_type_support( string $post_type, string|array $feature ) Register support of certain featur ...
- PHP Calendar 函数,wordpress函数get_calendar()用法示例
get_calendar( bool $initial = true, bool $echo = true ) Display calendar with days that have posts a ...
- escilpe mysql,wordpress函数esc_sql()用法示例
esc_sql( string|array $data ) Escapes data for use in a MySQL query. 描述 Usually you should prepare q ...
- php函数clean(),wordpress函数clean_url()用法示例
Warning: This function has been deprecated. Use esc_url() instead. clean_url( string $url, array $pr ...
- ?php get_sidebar(); ?,wordpress函数get_sidebar()用法示例
get_sidebar( string $name = null ) Load sidebar template. 描述 Includes the sidebar template for a the ...
- html class函数,wordpress函数sanitize_html_class()用法示例
sanitize_html_class( string $class, string $fallback = '' ) Sanitizes an HTML classname to ensure it ...
- php theexcerpt,wordpress的excerpt()函数的用法示例
本篇文章给大家带来的内容是关于wordpress的excerpt()函数的用法示例,有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助. 问题:在wordpres中的single页面,本身引 ...
最新文章
- spring事务-说说Propagation及其实现原理
- python常用数据结构
- 说实话,用完Gradle之后,有点嫌弃Maven了。贼好用!
- 执行计划生成及查看的几种方法
- RookeyFrame 隐藏 首次加载菜单 的伸缩动画
- 《python可以这样学》第一章
- 木兰宽松许可证(MulanPSL v2)解析
- 根据.jgwx配准文件绘制并加载图层
- 深度可分离卷积(Depthwise separable convolution)
- 电脑加域、exchange邮箱设置、绑定打印机
- Spring Cloud微服务实战
- Endnote 插入文献导致word崩溃!!解决方法
- 常用项目文档目录示例
- Ghelper安装及使用
- Kent Beck 教你编程模式与代码重构
- 小白刷LeeCode(算法篇)
- Android 音乐播放器SD卡本地播放器实现
- ubuntu 打印git邮箱_win 10配置Ubuntu子系统—可以考虑放弃VMware了
- containers详解
- Springboot拦截器实现IP黑名单