Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • ShemzoneShemzone
    Participant

    Thank you Peter. I will try the binding events.
    Could you confirme 2 things about Mime Type using by file_upload?

    1. Does it work to check Mime type in validation rules?
    2. Mime Type format is for exemple image/jpeg, not only jpeg or jpg?
    ShemzoneShemzone
    Participant

    Hi @Peter, have you had any feedback from the development team on this problem?

    in reply to: How to use the Metabox user dashboard for moderation #41347
    ShemzoneShemzone
    Participant

    Hi @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.

    in reply to: Type File and validation of MIME types: how does it work? #41261
    ShemzoneShemzone
    Participant

    Thank you @Peter.
    Please let me know as soon as you know
    Fred

    in reply to: On transition_post_status, notify author on publish #41210
    ShemzoneShemzone
    Participant

    [SOLVED]
    I had to use

     function 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 );
    in reply to: Open Street Map and Bricks. Code r doesn't work #39034
    ShemzoneShemzone
    Participant

    Hi @Peter
    That's it! Thank you a lot

    ShemzoneShemzone
    Participant

    Sorry, I found it: Group settings > Advanced > Group title

    ShemzoneShemzone
    Participant

    Hi @indatext.com
    I'm interested to know how did you managed your custom values from the UI. Could explain me please?

    in reply to: Open Street Map and Bricks. Code r doesn't work #39013
    ShemzoneShemzone
    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:122
    in reply to: Open Street Map and Bricks. Code r doesn't work #39012
    ShemzoneShemzone
    Participant

    Hi 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;
    }
    in reply to: Open Street Map and Bricks. Code r doesn't work #38992
    ShemzoneShemzone
    Participant

    Hi @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.

    in reply to: How can I be notified of a new submission? #37315
    ShemzoneShemzone
    Participant

    Thank you @Long Nguyen. I missed that part of the doc.

    ShemzoneShemzone
    Participant

    Hi 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
    }
    ShemzoneShemzone
    Participant

    To 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.

    ShemzoneShemzone
    Participant

    Hi,
    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.

Viewing 15 posts - 1 through 15 (of 17 total)