Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 1,021 through 1,035 (of 3,839 total)
  • Author
    Posts
  • in reply to: Metabox Date/Time Field Not Saving #47185
    PeterPeter
    Moderator

    Hello John,

    Regarding the saved time of the datetime field, if you add your custom save field format (Y-m-d) for the date, you also need to add the custom format for the time. For example Y-m-d h:i:s
    Refer to the PHP documentation https://www.php.net/manual/en/function.date.php

    If it still doesn't work on your site, please share your site admin account by submitting this contact form https://metabox.io/contact/
    I will take a look.

    in reply to: Changing the value of an option on submission. #47184
    PeterPeter
    Moderator

    Hello,

    It requires login to view the frontend form on the page so I cannot check the field type on your site https://kambriaevans.com/intensive-directory-submissions/

    If it is a select field, you need to assign the field to its option value which is registered when you create the field, such as other, green, blue ... and not the option label.

    Please follow the documentation https://docs.metabox.io/fields/select/

    in reply to: OSM and Groups #47183
    PeterPeter
    Moderator

    Hi,

    Thank you for your feedback.

    It is similar to this issue https://support.metabox.io/topic/issues-with-geocoding-address-field-map-field-in-groups/
    the development is working to fix the issue with geolocation in a group field and you can try to apply the fix in the topic above to see if it works.

    in reply to: Background image doesn't render in Gutenberg #47182
    PeterPeter
    Moderator

    Hello metafa,

    I'm using this code to output the image URL subfield value in a group and it works properly on my demo site:

    $image = RWMB_Image_Field::file_info( $my_image, ['size' => 'full'] );
    $image_url = $image['url'];
    ?>
    <div style="background-image: url(<?php echo $image_url ?>)"></div>

    Can you please share the code that you use to register the block or export the field group to a JSON file and share it here? I will help you check the issue.

    Following the documentation https://docs.metabox.io/extensions/meta-box-builder/#export--import

    in reply to: Metabox Date/Time Field Not Saving #47167
    PeterPeter
    Moderator

    Hello,

    After importing the field group to the demo site, I can add the value for the datetime field and save it as well, screenshot https://imgur.com/ecnXCkA

    Please let me know if this happens:
    1. with other fields.
    2. without Bricks builder.
    then you can try to increase the PHP setting max_input_vars and see if it helps. Read more about the PHP setting in the documentation https://metabox.io/wordpress-custom-fields-not-saving-increase-max-input-vars/

    PeterPeter
    Moderator

    Hello Emma,

    I test the frontend submission form of MB Frontend Submission on the demo site with the setting ajax="true" but don't see that issue. It could be an issue with the custom form of Bricks builder.

    You can follow the documentation https://docs.metabox.io/extensions/mb-frontend-submission/
    to use the MB frontend submission shortcode without using Bricks and check the issue again.

    in reply to: Upgrade to 5.10.4 breaks subgroups #47158
    PeterPeter
    Moderator

    Hello,

    I see there are two issues in the code that you create to output the field value:

    1. Missing the closing square bracket:

    - current:
    $image = RWMB_Image_Field::file_info( $image_id, [ 'size' => 'thumbnail' );

    - it should be:
    $image = RWMB_Image_Field::file_info( $image_id, [ 'size' => 'thumbnail' ] );

    2. Missing the field prefix when accessing the subgroup and subfields, for example:

    - current:

    // Field image:
    $image_ids = $subgroup[ 'image' ] ?? [];

    - it should be:

    // Field title:
    echo $subgroup[ 'ie-slider-title' ] ?? '';

    The correct code is:

    $groups = rwmb_meta( 'ie-slider-sliders' );
    foreach ( $groups as $group ) {
    	
    	// Field slider:
    	$subgroups = $group[ 'ie-slider-slider' ] ?? '';
    	foreach ( $subgroups as $subgroup ) {
    		
    		// Field title:
    		echo $subgroup[ 'ie-slider-title' ] ?? '';
    		
    		// Field image:
    		$image_ids = $subgroup[ 'ie-slider-image' ] ?? [];
    		?>
    		<h3>Uploaded images</h3>
    		<ul>
    			<?php foreach ( $image_ids as $image_id ) : ?>
    				<?php $image = RWMB_Image_Field::file_info( $image_id, [ 'size' => 'thumbnail' ] ); ?>
    				<li><img src="<?php echo $image['url']; ?>"></li>
    			<?php endforeach ?>
    		</ul>
    		<?php
    		
    		// Field caption:
    		echo $subgroup[ 'ie-slider-caption' ] ?? '';
    		
    		// Field description:
    		$values = $subgroup[ 'ie-slider-description' ] ?? '';
    		foreach ( $values as $value ) :
    			echo do_shortcode( wpautop( $value ) );
    		endforeach;	
    	}
    
    }
    in reply to: Metabox Date/Time Field Not Saving #47157
    PeterPeter
    Moderator

    Hello John,

    Thank you for your feedback. I've tried to reproduce the issue but didn't see that. I can normally save the date-time field value on the local site. Can you please export the field group to a JSON file and share it here? I will import the field group to my site and check the issue.
    Following the documentation https://docs.metabox.io/extensions/meta-box-builder/#export--import

    in reply to: Alignment doesn't works #47155
    PeterPeter
    Moderator

    Here you go https://docs.metabox.io/extensions/mb-blocks/#using-mb-views
    Notice the sample code:

    <div {{ mb.get_block_wrapper_attributes() }}>
        <img class="testimonial__image" src="{{ attributes.image.full_url }}">
        <div class="testimonial__body">
            <div class="testimonial__content" style="min-height: 50px;">
                <InnerBlocks />
            </div>
            <div class="testimonial__author">{{ attributes.name }}</div>
        </div>
    </div>
    in reply to: How to: Adding FAQ on webshop product #47153
    PeterPeter
    Moderator

    Hello Niki,

    Simply, you can create a field group and some custom fields, assign it to the product post type. After adding value to the field when editing the product post in the admin area, you can follow the documentation to output the field value in the frontend, just like other fields.
    https://docs.metabox.io/custom-fields/

    in reply to: Alignment doesn't works #47148
    PeterPeter
    Moderator

    Hello,

    If you use the View template, you can access the align attribute via the attributes variable. Here is an example:

    Print attributes: {{ attributes.align }}

    PeterPeter
    Moderator

    Hello,

    If you have a separate group with 3 custom fields, you can add the field group ID (meta box ID) to the frontend form shortcode to allow users to submit 3 fields in the frontend form.
    Please follow the documentation https://docs.metabox.io/extensions/mb-frontend-submission/#faq

    Here is an example:

    [mb_frontend_form id="meta-box-id-1,meta-box-id-2,meta-box-id-3" post_fields="title,content"]

    in reply to: Upgrade to 5.10.4 breaks subgroups #47144
    PeterPeter
    Moderator

    Hello Topher,

    Can you please also share the code that creates the field group? Or export the field group to a JSON file and share it here. I will import it to my demo site and use your code to output the subfield value to see how it displays in the frontend.
    Following the documentation https://docs.metabox.io/extensions/meta-box-builder/#export--import

    in reply to: Can I add taxonomy columns? #47140
    PeterPeter
    Moderator

    Hello Topher,

    Yes, you can add a column for the field on the taxonomy admin page. Please notice the default column name to show the custom column before/after it. See this screenshot https://imgur.com/a/Z41PD4M
    If the default column name is wrong, the custom column won't display on the taxonomy admin page.

    in reply to: rwmb_frontend_validate & Field data #47139
    PeterPeter
    Moderator

    Hello Nick,

    In the example code on the documentation page, we also share a way to get the post field data by using the global variable $_POST
    https://docs.metabox.io/extensions/mb-frontend-submission/#validation

    add_filter( 'rwmb_frontend_validate', function( $validate, $config ) {
        // Check only if you're on the right form.
        if ( 'your-meta-box-id' !== $config['id'] ) {
            return $validate;
        }
        // Check if users have selected files for an image upload field.
        if ( empty( $_POST['image_upload_field'] ) ) {
            $validate = false; // Return false to show an error message.
        }
        return $validate;
    }, 10, 2 );

    Please try this on your end and let me know how it goes.

Viewing 15 posts - 1,021 through 1,035 (of 3,839 total)