Forum Replies Created
-
AuthorPosts
-
August 7, 2023 at 10:49 PM in reply to: Image upload: validation message on max file size + finish uploading #42833
Shemzone
ParticipantThank you Peter. I will try the binding events.
Could you confirme 2 things about Mime Type using by file_upload?- Does it work to check Mime type in validation rules?
- Mime Type format is for exemple image/jpeg, not only jpeg or jpg?
May 26, 2023 at 2:04 PM in reply to: Type File and validation of MIME types: how does it work? #41941Shemzone
ParticipantHi @Piotr and thanks for your suggestions. I will try to implement them. About the moderation, yes it is about that, publish or not (or hide) the posts.
March 29, 2023 at 7:36 PM in reply to: Type File and validation of MIME types: how does it work? #41261Shemzone
Participant[SOLVED]
I had to usefunction notify_author_on_publish( $new_status, $old_status, $post )... $author_email = rwmb_meta( "author_email", "", $post->ID ); $firstname = rwmb_meta( "firstname", "", $post->ID );instead of
function notify_author_on_publish( $new_status, $old_status, $post_id )... $author_email = rwmb_meta( "author_email", "", $post_id ); $firstname = rwmb_meta( "firstname", "", $post_id );November 9, 2022 at 2:17 AM in reply to: ✅Is it possible to customize entry titles for clonable sub-group? #39017Shemzone
ParticipantSorry, I found it: Group settings > Advanced > Group title
November 9, 2022 at 2:11 AM in reply to: ✅Is it possible to customize entry titles for clonable sub-group? #39016Shemzone
ParticipantHi @indatext.com
I'm interested to know how did you managed your custom values from the UI. Could explain me please?Shemzone
Participant@Peter
in addition, here is the console log (seem to expect a Google API Key Map, that I don't use):Google Maps JavaScript API error: InvalidKeyMapError js?key=AIzaSyC1mUh87SGFyf133tpZQJa-s96p0tgnraQ&libraries=places&ver=5.6.7:91 https://developers.google.com/maps/documentation/javascript/error-messages#invalid-key-map-error _.pe @ js?key=AIzaSyC1mUh87SGFyf133tpZQJa-s96p0tgnraQ&libraries=places&ver=5.6.7:91 (anonyme) @ common.js:137 (anonyme) @ common.js:258 c @ common.js:122Shemzone
ParticipantHi again @Peter
I did a test directly from a PHP file using the following code, same result:echo '<h1>Test OSM Maps</h1>'; $args = [ 'width' => '640px', 'height' => '480px', 'zoom' => 14, 'marker' => true ]; $group_values = rwmb_meta( 'group_contacts', '', 204 ); // If group is cloneable foreach ( $group_values as $group_value ) { echo RWMB_Map_Field::render_map( $group_value['contact_map'], $args ); echo '--------------'; }The weird part is the maps display for 1 second and are immediatly replaced by a Google Maps message. See the screen record https://www.loom.com/share/e8782b7add2b4038800d970cef7a8bf9
Here his the fields PHP code:
add_filter( 'rwmb_meta_boxes', 'test_mb_palais' ); function test_mb_palais( $meta_boxes ) { $prefix = 'palais-'; $meta_boxes[] = [ 'title' => __( 'Palais', 'your-text-domain' ), 'id' => 'palais', 'post_types' => ['palais'], 'fields' => [ [ 'name' => __( 'Sous-titre', 'your-text-domain' ), 'id' => $prefix . 'text_subtitle', 'type' => 'text', ], [ 'type' => 'heading', 'name' => __( 'Comment y aller', 'your-text-domain' ), ], [ 'name' => __( 'En train', 'your-text-domain' ), 'id' => $prefix . 'textarea_train', 'type' => 'wysiwyg', ], [ 'name' => __( 'En avion', 'your-text-domain' ), 'id' => $prefix . 'textarea_avion', 'type' => 'wysiwyg', ], [ 'name' => __( 'En voiture', 'your-text-domain' ), 'id' => $prefix . 'textarea_voiture', 'type' => 'wysiwyg', ], [ 'name' => __( 'Juridictions', 'your-text-domain' ), 'id' => $prefix . 'textarea_juridictions', 'type' => 'wysiwyg', ], [ 'name' => __( 'À découvrir', 'your-text-domain' ), 'id' => $prefix . 'textarea_discover', 'type' => 'wysiwyg', ], [ 'type' => 'heading', 'name' => __( 'Contacts et adresses', 'your-text-domain' ), ], [ 'name' => __( 'Contacts', 'your-text-domain' ), 'id' => $prefix . 'group_contacts', 'type' => 'group', 'collapsible' => true, 'default_state' => 'collapsed', 'clone' => true, 'sort_clone' => true, 'add_button' => __( 'Ajouter une adresse', 'your-text-domain' ), 'fields' => [ [ 'name' => __( 'Intitulé', 'your-text-domain' ), 'id' => $prefix . 'contact_title', 'type' => 'text', ], [ 'name' => __( 'Adresse', 'your-text-domain' ), 'id' => $prefix . 'contact_address', 'type' => 'text', ], [ 'name' => __( 'Téléphone', 'your-text-domain' ), 'id' => $prefix . 'contact_phone', 'type' => 'text', ], [ 'name' => __( 'Email', 'your-text-domain' ), 'id' => $prefix . 'contact_email', 'type' => 'email', ], [ 'name' => __( 'Horaires', 'your-text-domain' ), 'id' => $prefix . 'contact_opening_hours', 'type' => 'wysiwyg', ], [ 'name' => __( 'Transports en commun', 'your-text-domain' ), 'id' => $prefix . 'contact_public_transportation', 'type' => 'wysiwyg', ], [ 'name' => __( 'Carte', 'your-text-domain' ), 'id' => $prefix . 'contact_map', 'type' => 'osm', 'address_field' => 'contact_address', 'language' => 'fr', 'region' => 'fr', ], ], ], ], ]; return $meta_boxes; }Shemzone
ParticipantHi @Peter and thank you for your attention to my problem.
I'm a bit stuck in the process to test the code.
Do I need to export the fields by following the documentation from https://docs.metabox.io/extensions/meta-box-builder/#getting-php-code and paste it in my functions.php? If yes, what next?
Or do I need only test this code in a PHP file?
If yes, how to pass the post (slug? id?) value to render the custom fields values?<?php $args = [ 'width' => '640px', 'height' => '480px', ]; $group_values = rwmb_meta( 'group_contacts' ); // If group is cloneable foreach ( $group_values as $group_value ) { echo RWMB_Map_Field::render_map( $group_value['contact_map'], $args ); } ?>I can't really bypass bricks theme because if I do (chosing another theme and create a template), it brokes all the website. I did and ahd a hard time to get it all back.
Shemzone
ParticipantThank you @Long Nguyen. I missed that part of the doc.
April 21, 2022 at 4:27 PM in reply to: ✅Display custom taxonomy with posts having meta_key=xyz and meta_value=1 #35745Shemzone
ParticipantHi Long and thank you.
I have managed this in a different way but similar. For now it works. I'm going to improve it, especially on the loop part because I'm not confortable with the repeated WP_Query within the loop.function projects_get_filters_homepage( $taxonomy ) { $terms = get_terms( $taxonomy ); $count = count($terms); ?> <div class="projects-categories filter-button-group"> <button class="shz-btn--s active" data-filter="*"><?php esc_html_e( 'Tout', 'text-domain' ); ?></button> <?php if ( $count > 0 ){ foreach ( $terms as $term ) { $args = array( 'post_type' => 'project', 'meta_key' => 'display_homepage', 'meta_value' => '1', 'tax_query' => array( 'relation' => 'AND', array( 'taxonomy' => 'project-taxonomy', 'field' => 'slug', 'terms' => $term->slug ) ) ); $my_query = new WP_Query( $args ); if ( (int)$my_query->post_count > 0 ) { ?> <button class="shz-btn--s" data-filter=".<?php echo esc_attr( $term->slug ); ?>"><?php echo esc_html( $term->name ); ?></button> <?php } } } ?> </div> <?php }March 20, 2022 at 12:07 AM in reply to: ✅Content of custom field saved on a page but not when the page is the frontpage #34615Shemzone
ParticipantTo keep you informed. I've tried a lot of combinations, there's something that prevents Metabox from saving my changes but I don't really know what. I tested by deleting my elements on by one in Oxygen and after finding the problematic ones (quite classic though), I saved them into reusable elements. And it works like that but I don't know why.
I will test again with the final Oxygen 4 version.March 14, 2022 at 11:42 PM in reply to: ✅Content of custom field saved on a page but not when the page is the frontpage #34517Shemzone
ParticipantHi,
Thank you, I did it and found that Oxygen 4.0 beta 1 is the faulty. In addition, it must be something wrong on my page (not an Oxygen Template but a page completely built in Oxygen). I have to check by rebuilding the whole page to find what element is the issue. -
AuthorPosts