函数文档

options_reading_blog_charset()

💡 云策文档标注

概述

options_reading_blog_charset() 函数用于渲染站点字符编码设置,输出一个包含描述文本的 HTML 元素,通常用于 WordPress 后台设置页面。

关键要点

  • 函数输出一个空的 HTML 元素,并显示关于站点字符编码的翻译文本,推荐使用 UTF-8。
  • 该函数在 WordPress 3.5.0 版本中引入,属于核心功能的一部分。
  • 相关函数包括 __() 用于文本翻译、esc_attr() 用于 HTML 属性转义、get_option() 用于获取选项值。

📄 原文内容

Render the site charset setting.

Source

function options_reading_blog_charset() {
	echo '<input name="blog_charset" type="text" id="blog_charset" value="' . esc_attr( get_option( 'blog_charset' ) ) . '" class="regular-text" />';
	echo '<p class="description">' . __( 'The <a href="https://wordpress.org/documentation/article/wordpress-glossary/#character-set">character encoding</a> of your site (UTF-8 is recommended)' ) . '</p>';
}

Changelog

Version Description
3.5.0 Introduced.