File Upload field do not show in admin Column
Support › MB Admin Columns › File Upload field do not show in admin ColumnResolved
- This topic has 4 replies, 2 voices, and was last updated 3 years, 5 months ago by
Régis Evennou.
Viewing 5 posts - 1 through 5 (of 5 total)
-
AuthorPosts
-
November 23, 2021 at 5:57 PM #32117
Régis Evennou
ParticipantHi,
I use the builder to create a field group. The File Upload field shows well when i create the field, but when i change the field order in the group, it does no show any more.
How can i fix it ?
Thank youNovember 24, 2021 at 11:00 AM #32129Long Nguyen
ModeratorHi,
I do not see that issue on my end. Can you please share the code that creates the file upload field before and after re-ordering?
November 24, 2021 at 5:08 PM #32138Régis Evennou
ParticipantHi,
Here is the code.
Thank you 🙂<?php add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' ); function your_prefix_function_name( $meta_boxes ) { $prefix = ''; $meta_boxes[] = [ 'title' => __( 'Demande de résidence', 'your-text-domain' ), 'id' => 'cie-submit', 'post_types' => ['espace-cie'], 'fields' => [ [ 'name' => __( 'Description du projet de résidence', 'your-text-domain' ), 'id' => $prefix . 'description_du_projet_de_residence', 'type' => 'wysiwyg', ], [ 'name' => __( 'Nom de l\'auteur', 'your-text-domain' ), 'id' => $prefix . 'nom_de_l\'auteur', 'type' => 'text', 'desc' => __( 'Le nom de l\'auteur du texte', 'your-text-domain' ), 'admin_columns' => 'after discipline_artistique', ], [ 'name' => __( 'Distribution / Equipe', 'your-text-domain' ), 'id' => $prefix . 'distribution_equipe', 'type' => 'wysiwyg', ], [ 'name' => __( 'Période souhaitée', 'your-text-domain' ), 'id' => $prefix . 'periode_souhaitee', 'type' => 'text', 'admin_columns' => 'after partenaires_du_projet', ], [ 'name' => __( 'Discipline artistique', 'your-text-domain' ), 'id' => $prefix . 'discipline_artistique', 'type' => 'text', 'admin_columns' => 'after title', ], [ 'name' => __( 'Image', 'your-text-domain' ), 'id' => $prefix . 'artiste_image', 'type' => 'image', 'admin_columns' => 'after title', ], [ 'name' => __( 'Partenaires du projet', 'your-text-domain' ), 'id' => $prefix . 'partenaires_du_projet', 'type' => 'wysiwyg', ], [ 'id' => $prefix . 'hidden_cie_name', 'type' => 'hidden', 'admin_columns' => [ 'position' => 'after title', 'title' => 'Nom de la cie', 'sort' => true, 'searchable' => true, 'filterable' => true, ], 'sanitize_callback' => 'nom_de_la_cie', ], [ 'name' => __( 'File Upload ok', 'your-text-domain' ), 'id' => $prefix . 'file_upload_ok', 'type' => 'file_upload', 'admin_columns' => [ 'position' => 'after artiste_image', 'title' => 'Dossier', ], ], ], ]; return $meta_boxes; }
---- AFTER -------------------------------
<?php add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' ); function your_prefix_function_name( $meta_boxes ) { $prefix = ''; $meta_boxes[] = [ 'title' => __( 'Demande de résidence', 'your-text-domain' ), 'id' => 'cie-submit', 'post_types' => ['espace-cie'], 'fields' => [ [ 'name' => __( 'Description du projet de résidence', 'your-text-domain' ), 'id' => $prefix . 'description_du_projet_de_residence', 'type' => 'wysiwyg', ], [ 'name' => __( 'File Upload ok', 'your-text-domain' ), 'id' => $prefix . 'file_upload_ok', 'type' => 'file_upload', 'admin_columns' => [ 'position' => 'after artiste_image', 'title' => 'Dossier', ], ], [ 'name' => __( 'Nom de l\'auteur', 'your-text-domain' ), 'id' => $prefix . 'nom_de_l\'auteur', 'type' => 'text', 'desc' => __( 'Le nom de l\'auteur du texte', 'your-text-domain' ), 'admin_columns' => 'after discipline_artistique', ], [ 'name' => __( 'Distribution / Equipe', 'your-text-domain' ), 'id' => $prefix . 'distribution_equipe', 'type' => 'wysiwyg', ], [ 'name' => __( 'Période souhaitée', 'your-text-domain' ), 'id' => $prefix . 'periode_souhaitee', 'type' => 'text', 'admin_columns' => 'after partenaires_du_projet', ], [ 'name' => __( 'Discipline artistique', 'your-text-domain' ), 'id' => $prefix . 'discipline_artistique', 'type' => 'text', 'admin_columns' => 'after title', ], [ 'name' => __( 'Image', 'your-text-domain' ), 'id' => $prefix . 'artiste_image', 'type' => 'image', 'admin_columns' => 'after title', ], [ 'name' => __( 'Partenaires du projet', 'your-text-domain' ), 'id' => $prefix . 'partenaires_du_projet', 'type' => 'wysiwyg', ], [ 'id' => $prefix . 'hidden_cie_name', 'type' => 'hidden', 'admin_columns' => [ 'position' => 'after title', 'title' => 'Nom de la cie', 'sort' => true, 'searchable' => true, 'filterable' => true, ], 'sanitize_callback' => 'nom_de_la_cie', ], ], ]; return $meta_boxes; }
November 25, 2021 at 9:39 AM #32154Long Nguyen
ModeratorHi,
I see the issue. You need to register the field
artiste_image
before the fieldfile_upload_ok
to show the admin column after the fieldartiste_image
.function your_prefix_function_name( $meta_boxes ) { $prefix = ''; $meta_boxes[] = [ 'title' => __( 'Demande de résidence', 'your-text-domain' ), 'id' => 'cie-submit', 'post_types' => ['espace-cie'], 'fields' => [ [ 'name' => __( 'Description du projet de résidence', 'your-text-domain' ), 'id' => $prefix . 'description_du_projet_de_residence', 'type' => 'wysiwyg', ], [ 'name' => __( 'Image', 'your-text-domain' ), 'id' => $prefix . 'artiste_image', 'type' => 'image', 'admin_columns' => 'after title', ], [ 'name' => __( 'File Upload ok', 'your-text-domain' ), 'id' => $prefix . 'file_upload_ok', 'type' => 'file_upload', 'admin_columns' => [ 'position' => 'after artiste_image', 'title' => 'Dossier', ], ], ... ], ]; return $meta_boxes; }
November 26, 2021 at 8:31 PM #32180Régis Evennou
ParticipantOk thx 🙂
-
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.