|
|
@@ -128,3 +128,22 @@ function cmb2_sample_metaboxes() {
|
|
128
|
128
|
'render_row_cb' => 'cmb_hero_render_row_cb'
|
|
129
|
129
|
) );
|
|
130
|
130
|
}
|
|
|
131
|
+
|
|
|
132
|
+add_action( 'cmb2_admin_init', 'cmb2_artist_sort_metaboxes' );
|
|
|
133
|
+function cmb2_artist_sort_metaboxes() {
|
|
|
134
|
+ $cmb = new_cmb2_box( array(
|
|
|
135
|
+ 'id' => 'artist_sort_metabox',
|
|
|
136
|
+ 'title' => __( 'Name Override', 'cmb2' ),
|
|
|
137
|
+ 'object_types' => array( 'artist' ),
|
|
|
138
|
+ 'context' => 'normal',
|
|
|
139
|
+ 'priority' => 'high',
|
|
|
140
|
+ 'show_names' => true,
|
|
|
141
|
+ 'show_in_rest' => WP_REST_Server::READABLE
|
|
|
142
|
+ ) );
|
|
|
143
|
+ $cmb->add_field( array(
|
|
|
144
|
+ 'name' => __( 'Alternate Name', 'cmb2' ),
|
|
|
145
|
+ 'desc' => __( 'Name to use for alphabetical sorting', 'cmb2' ),
|
|
|
146
|
+ 'id' => 'artist-sort-name',
|
|
|
147
|
+ 'type' => 'text'
|
|
|
148
|
+ ) );
|
|
|
149
|
+}
|