我正在使用人造的自定义元框框架(https://github.com/humanmade/Custom-Meta-Boxes). 我想在我的metabox中添加一个select下拉列表,它是从我的WP站点上的角色填充的。如何使用网站上的当前角色填充select字段?
我试图给我们一个post\\u select字段和WP\\u查询角色,但不确定这是否可行:
array(
\'id\' => $prefix . \'role\',
\'name\' => \'Role\',
\'type\' => \'post_select\',
\'use_ajax\' => false,
\'query\' => array( \'wp_roles\' => array(\'get_names\') )
),
);