WC_Admin_API_Keys_Table_List::column_permissions()publicWC 1.0

Return permissions column.

Method of the class: WC_Admin_API_Keys_Table_List{}

No Hooks.

Return

String.

Usage

$WC_Admin_API_Keys_Table_List = new WC_Admin_API_Keys_Table_List();
$WC_Admin_API_Keys_Table_List->column_permissions( $key );
$key(array) (required)
Key data.

WC_Admin_API_Keys_Table_List::column_permissions() code WC 9.4.2

public function column_permissions( $key ) {
	$permission_key = $key['permissions'];
	$permissions    = array(
		'read'       => __( 'Read', 'woocommerce' ),
		'write'      => __( 'Write', 'woocommerce' ),
		'read_write' => __( 'Read/Write', 'woocommerce' ),
	);

	if ( isset( $permissions[ $permission_key ] ) ) {
		return esc_html( $permissions[ $permission_key ] );
	} else {
		return '';
	}
}