Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'rwmb_meta_boxes', 'user_profile' );
- function user_profile( $meta_boxes ) {
- $terms = get_terms( 'custom_taxonomy', array( 'hide_empty' => false ) );
- $options = array();
- foreach ( $terms as $term ){
- $options[ $term->term_id ] = $term->name ;
- }
- $meta_boxes[] = array(
- 'title' => 'Title',
- 'type' => 'user',
- 'fields' => array(
- array(
- 'name' => esc_html__( 'Name', 'textdomain' ),
- 'id' => "_myid",
- 'type' => 'select_advanced',
- 'options' => $options,
- ),
- ),
- );
- return $meta_boxes;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement