wp_get_themes()获取当前博客的所有主题的信息

目录

描述

Returns an array of WP_Theme objects based on the argument.

wp_get_themes() 描述

用法

<?php $themes wp_get_themes$args ); ?>

wp_get_themes() 用法

参数

$args

(array) (可选) This array can have the key/value pairs below.

默认值: array( 'errors' => false , 'allowed' => null, 'blog_id' => 0 )

  • 'errors': mixed. Defaults to false.
    • true to return themes with errors.
    • false to return themes without errors.
    • null to return all themes.
  • 'allowed': mixed. (Multisite) Defaults to null.
    • true to return only allowed themes for a site.
    • false to return only disallowed themes for a site.
    • 'site' to return only site-allowed themes.
    • 'network' to return only network-allowed themes.
    • null to return all themes.
  • 'blog_id': int. (Multisite) The blog ID used to calculate which themes are allowed. Defaults to 0, synonymous with the current blog.

wp_get_themes() 参数

返回值

This function returns an array of WP_Theme objects. See wp_get_theme().

wp_get_themes() 返回值

历史

添加于 版本: 3.4.0

wp_get_themes() 历史

源文件

wp_get_themes() 函数的代码位于 wp-includes/theme.php.

wp_get_themes() 源文件

相关