Hello,
You can use the code to register the field and get the current user then assign it to the setting query_args
. For example:
add_filter( 'rwmb_meta_boxes', 'callback_function' );
function callback_function( $meta_boxes ) {
$current_user_id = get_current_user_id();
$meta_boxes[] = [
'title' => __( 'My Custom Fields', 'your-text-domain' ),
'id' => 'my_custom_fields',
'post_types' => ['post'],
'fields' => [
[
'id' => 'funnel_post',
'title' => 'Funnel Post',
'type' => 'post',
'post_type' => 'funnel',
'query_args' => [
'author' => $current_user_id,
],
],
],
];
return $meta_boxes;
}
Refer documentation https://docs.metabox.io/fields/post/
https://developer.wordpress.org/reference/classes/wp_query/#author-parameters