Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 2,131 through 2,145 (of 3,727 total)
  • Author
    Posts
  • in reply to: Can't get an relation or to work in meta_query #43588
    PeterPeter
    Moderator

    Hello,

    The array and object in Twig are different a bit from PHP. You can change the code to this one:

    {% set date_query = {
    	relation: 'OR',
    	0: {
    		key: 'departure_date',
    		value: 'now'|date("Y-m-d"),
    		compare: '<',
    		type: 'DATE'
    	},
    	1: {
    		key: 'departure_date',
    		compare: 'NOT EXISTS',
    		type: 'DATE'
    	}
    } %}
    in reply to: Second button in line with yours #43586
    PeterPeter
    Moderator

    Hello,

    If you add something to the default form, you should create some custom CSS code to style that element. I think it is expected.
    If you don't know how to create CSS code, please contact us here https://metabox.io/contact/
    our development team will help you with a small fee.

    in reply to: Reusing field groups #43577
    PeterPeter
    Moderator

    Hello Yasmine,

    You can define an array of custom fields that is not changed across field groups (reusable), then use the function array_merge() to add more fields to the reusable field group to other field groups for your requirements. For example:

    add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' );
    function your_prefix_function_name( $meta_boxes ) {
        // Reusing field group 1
        $field_group_1 = [
            [
                'name'          => __( 'Datetime', 'your-text-domain' ),
                'id'            => 'datetime_jeq28wycry',
                'type'          => 'datetime',
            ]
    
        ];
    
        $additional_fields = [
            [
                'name' => __( 'Custom Html', 'your-text-domain' ),
                'type' => 'custom_html',
            ],
    
        ];
    
        $field_group_2 = array_merge( $field_group_1, $additional_fields );
    
        $meta_boxes[] = [
            'title'  => __( 'Field Group 1', 'your-text-domain' ),
            'id' => 'field-group-1',
            'post_types' => 'page',
            'fields' => $field_group_1,
        ];
    
        $meta_boxes[] = [
            'title'  => __( 'Field Group 2', 'your-text-domain' ),
            'id' => 'field-group-2',
            'post_types' => 'page',
            'fields' => $field_group_2,
        ];
    
        return $meta_boxes;
    }
    in reply to: receive notifications #43576
    PeterPeter
    Moderator

    Hello,

    There is a parameter rwmb_frontend_field_post_id in the URL when you edit a post. Then you can use the code below to check if it is a new post submitted (not an edited post):

    add_action( 'rwmb_frontend_after_process', function( $config, $post_id ) {
        if( empty( $_GET['rwmb_frontend_field_post_id'] ) ) {
            // your code to send email goes here
        }
    }, 20, 2 );
    in reply to: License is Invalid Error #43575
    PeterPeter
    Moderator

    Hello Mark,

    Please contact us here https://metabox.io/contact/
    the development team will help you to fix the issue with the license key.

    PeterPeter
    Moderator

    Hello,

    The problem here is the field single_image supports uploading images via the WordPress media library popup and WordPress does not allow subscriber user role to upload images. You can read more here https://wordpress.org/support/topic/subscriber-role-cannot-upload-media-file/

    So in this case, you can use the field type image or image_upload which supports uploading images and it doesn't open the Media Library popup.

    in reply to: Elementor Image Carousel not working with settings #43560
    PeterPeter
    Moderator

    Hello Lisa,

    Do you use the images from Media Library instead of Meta Box custom field? Let me know how it goes.

    in reply to: Issue with Meta Box Relationships #43557
    PeterPeter
    Moderator

    Hello Stephen,

    You should use the "Reciprocal" option when creating a relationship between one post type, for example: post-to-post, page-to-page. It will prevent two relationship meta boxes when editing a post.

    using a product_faq custom field: it looks like you are using a post custom field. The relationship has a separate meta box with a select field when editing the post (Product or FAQ). If it does not work as expected, can you please share some screenshots of the relationship on your site?

    Read more in the documentation https://docs.metabox.io/extensions/mb-relationships/#using-meta-box-builder

    in reply to: restrict add new setting page to administrators #43555
    PeterPeter
    Moderator

    Hello,

    curently editors can create new setting pages

    I do not see that on my demo site. Only the administrator can access the Meta Box builder (mb post types) to create a settings page. Do you use a custom code or a third-party plugin that changes the capabilities of the editor role?

    in reply to: Using Shortcode for Link #43554
    PeterPeter
    Moderator

    Hello there,

    You can try to switch to tab Text and use this sample code to add the helper shortcode to the <a> tag.

    test <a href="[rwmb_meta id='url_field']">content</a>

    Remember to replace the double quotes with single quote in the shortcode.

    PeterPeter
    Moderator

    Hello,

    Do you use the field type select when registering the relationship between "bookings" & "enquiries"? Please share the code that you use to register the relationship, I will help you to check the issue.

    in reply to: Regex Validation #43546
    PeterPeter
    Moderator

    Hello,

    For the HTML5 attribute, you can use the attribute pattern. For the advanced validation, you can use the remote validation. Then add your own regex to validate the input value.

    Following the documentation
    https://docs.metabox.io/validation/
    https://www.w3schools.com/tags/att_input_pattern.asp

    in reply to: Default value for datetime picker #43545
    PeterPeter
    Moderator

    Hello,

    You can use the settings minTime and maxTime to set the selectable time range. Please follow the documentation
    https://trentrichardson.com/examples/timepicker/#tp-options
    https://docs.metabox.io/fields/datetime/#settings

    in reply to: Custom Fields Data Disappeared #43539
    PeterPeter
    Moderator

    Hello Elene,

    You can try to follow this tutorial to increase the PHP setting max_input_vars to fix the issue
    https://metabox.io/wordpress-custom-fields-not-saving-increase-max-input-vars/

    Let me know how it goes.

    in reply to: Elementor Image Carousel not working with settings #43538
    PeterPeter
    Moderator

    Hello Lisa,

    I have received a report from a user that relates to the Elementor Loop feature. If you use the carousel image in a loop widget, it only displays the first image even with a list image manually selected from WordPress (not using Meta Box field). Can you please confirm this on your site?

Viewing 15 posts - 2,131 through 2,145 (of 3,727 total)