wp_dropdown_roles

函数


wp_dropdown_roles ( $selected = '' )
参数
  • (string)
    $selected
    Slug for the role that should be already selected.
    Required:
    Default: (empty)
定义位置
  • wp-admin/includes/template.php
    , line 946
引入
2.1.0
弃用

Prints out option HTML elements for role selectors.

function wp_dropdown_roles( $selected = '' ) {
	$r = '';

	$editable_roles = array_reverse( get_editable_roles() );

	foreach ( $editable_roles as $role => $details ) {
		$name = translate_user_role( $details['name'] );
		// Preselect specified role.
		if ( $selected === $role ) {
			$r .= "nt";
		} else {
			$r .= "nt";
		}
	}

	echo $r;
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。