WordPress抛出此错误消息:
警告:缺少
_x()
的参数2,在"目录/ posttypes.php"中调用在第8行并在第250行"目录/ l10n.php中定义
postypes.php:
// Add new post type for Recipes
add_action('init', 'cooking_recipes_init');
function cooking_recipes_init()
{
$args = array(
'label' => _x('Recipes'),
'singular_label' => _x('Recipe'),
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'query_var' => true,
'rewrite' => true,
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => null,
'supports' => array('title','editor','comments')
);
register_post_type('recipes',$args);
}
的functions.php:
include_once(ABSPATH . 'wp-content/themes/twentyeleven-child/posttypes.php');
l10n.php:
function _x( $text, $context, $domain = 'default' ) {
return translate_with_gettext_context( $text, $context, $domain );
}
任何建议都会非常感谢,谢谢