Hello,
I have been trying to display a custom field for Woocommerce Users but so far no luck :/. I don't understand where I am doing the mistake. Please could you have a look at my code?
Thanks guys!
<?php
add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' );
function your_prefix_function_name( $meta_boxes ) {
$prefix = '';
$meta_boxes[] = [
'title' => __( 'Premium Membership', 'your-text-domain' ),
'id' => 'premium-membership',
'type' => 'user',
'include' => [
'relation' => 'OR',
'user_role' => ['administrator'],
'edited_user_role' => ['customer'],
],
'fields' => [
[
'name' => __( 'Expired Date', 'your-text-domain' ),
'id' => $prefix . 'expired_date',
'type' => 'text',
'admin_columns' => [
'position' => 'after name',
'sort' => true,
],
'columns' => 6,
],
],
];
return $meta_boxes;
}