Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 2,236 through 2,250 (of 3,839 total)
  • Author
    Posts
  • in reply to: Getting started with Site Settings and Gutenberg #43610
    PeterPeter
    Moderator

    Hello,

    You can click on Advanced link to get the option name and replace it with "site_option" in the shortcode above, screenshot https://imgur.com/dXrQGKP

    [rwmb_meta id="phone" object_id="settings_page_123" object_type="setting"]

    in reply to: Get related /connecetd Term Name inside a Group #43601
    PeterPeter
    Moderator

    Hello,

    How do you set the relation between terms on your site? If you use the MB Relationships plugin, you can follow the documentation to get the related/connected term https://docs.metabox.io/extensions/mb-relationships/#terms

    in reply to: Meta Query - Elementor #43600
    PeterPeter
    Moderator

    Hello,

    The relation OR might help you in this case. For example:

    // Append our meta query
    $meta_query = [
    	'relation' => 'OR',
    	[
    		'key' => 'end_dato',
    		'value' => date("Y-m-d",time()),
    		'compare' => '<=',
    	],
    	[
    		'key' => 'start_dato',
    		'value' => date("Y-m-d",time()),
    		'compare' => '>=',
    	]
    
    ];

    Read more about custom field parameter in the WordPress documentation https://developer.wordpress.org/reference/classes/wp_query/#custom-field-post-meta-parameters

    in reply to: Repeater field #43592
    PeterPeter
    Moderator

    Hello Kris,

    It's the cloneable feature and it's a native feature of all fields. In the builder, you can enable the Cloneable option when editing the field. Please follow this documentation https://docs.metabox.io/cloning-fields/

    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

Viewing 15 posts - 2,236 through 2,250 (of 3,839 total)