Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 2,191 through 2,205 (of 3,790 total)
  • Author
    Posts
  • in reply to: Conditional logic #43591
    PeterPeter
    Moderator

    Hello Yasmine,

    Can you please share some screenshots or a screen record of the issue? Do you use a multi-step form, show the current step (page) and hide other ones?

    in reply to: receive notifications #43590
    PeterPeter
    Moderator

    Hello,

    1. You can combine your code in the second comment (https://support.metabox.io/topic/receive-notifications/?swcfpc=1#post-43569) to check the specific form by form ID and send the email.

    2. I'm not sure if a third-party plugin can cause this issue but the send function works as it is. It isn't a Meta Box issue itself.

    3. You can get the field email value via the $_POST variable. For example:

    wp_mail( $_POST['custom_field_id'],'New submission', 'A new post has been just submitted.');
    
    in reply to: Exclude Blocks from the Block Based Widgets Editor #43589
    PeterPeter
    Moderator

    Hello there,

    You can use PHP code to register the block, then check if the current page is the widget page and return $meta_boxes variable at that point. For example:

    // Register a hero content block for Gutenberg.
    add_filter( 'rwmb_meta_boxes', function( $meta_boxes ) {
        global $pagenow;
        if ( $pagenow == 'widgets.php' ) {
            return $meta_boxes;
        }
    
        $meta_boxes[] = [
            'title' => 'Hero Area',
            'id'    => 'hero-area',
            'type'  => 'block', // Important.
            ...
        ];
        return $meta_boxes;
    } );

    Follow the WordPress documentation https://codex.wordpress.org/Global_Variables#Admin_Globals

    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

Viewing 15 posts - 2,191 through 2,205 (of 3,790 total)