我已经被交给了以前的开发人员的工作,所以我正在分析我的圈子,孩子主题的functions.php。
基本上有这样的代码,除了__()部分之外,我知道函数是做什么的:
register_post_type( 'services',
array(
'labels' =>
array(
'name' => __( 'Services' , 'circles'),
'singular_name' => __( 'Service' , 'circles')
),
'public' => true,
'has_archive' => false,
'rewrite' => array( 'slug' => 'services' ),
'supports' => array('title',
'editor',
//'author',
'thumbnail',
//'excerpt',
//'comments'
'page-attributes'
)
)
);我知道在PHP ()中,__construct()引用类的构造函数,但不确定WordPress中的上述语法。
谢谢。问候
发布于 2014-12-15 16:37:13
它们是可翻译的字符串。当开发一个主题时,如果您需要将主题翻译到另一个语言中,那么您就需要它们。
__() -参考资料:http://codex.wordpress.org/Function_参考/参考_2有很多种:http://codex.wordpress.org/L10n
了解更多:
https://wordpress.stackexchange.com/questions/172342
复制相似问题