get_theme_mods()
get_theme_mods() 检索所有主题修改。Retrieve all theme modificati…
get_theme_mods()
检索所有主题修改。
Retrieve all theme modifications.
目录锚点:#返回#源码#笔记
返回(Return)
(array|void)主题修改。
源码(Source)
/**
* Retrieve all theme modifications.
*
* @since 3.1.0
*
* @return array|void Theme modifications.
*/
function get_theme_mods() {
$theme_slug = get_option( 'stylesheet' );
$mods = get_option( "theme_mods_$theme_slug" );
if ( false === $mods ) {
$theme_name = get_option( 'current_theme' );
if ( false === $theme_name )
$theme_name = wp_get_theme()->get('Name');
$mods = get_option( "mods_$theme_name" ); // Deprecated location.
if ( is_admin() && false !== $mods ) {
update_option( "theme_mods_$theme_slug", $mods );
delete_option( "mods_$theme_name" );
}
}
return $mods;
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 3.1.0 | wp-includes/theme.php:890 | 3 | 6 |
笔记(Notes)
例子
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。





还没有任何评论,赶紧来占个楼吧!