Support Forum » User Profile

Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • in reply to: Editor Color Palette #40235
    Sam UnderwoodSam Underwood
    Participant

    Is it possible to investigate getting this added as a feature of MB Blocks? Using as much native Gutenberg features as possible would be preferable.

    Sam UnderwoodSam Underwood
    Participant

    It worked perfectly.
    I didn't need to use init for my case though.
    Thanks!

    in reply to: Image fields not carried over when duplicating a post #37154
    Sam UnderwoodSam Underwood
    Participant
    // duplicate MetaBox images
            $images_value = rwmb_meta( 'card_images', $args = '', $post_id);
            foreach ( $images_value as $single_image ) {
                add_post_meta($new_post_id, 'card_images', $single_image, false);
                //rwmb_set_meta($new_post_id, 'card_images', $single_image);
            }

    add_post_meta doesn't seem to work. Maybe I'm doing something wrong?
    rwmb_set_meta kinda works, but it ends up only saving the last image.

    Sam UnderwoodSam Underwood
    Participant

    Unsure what you'd like screenshots of, I can share with you a video of the issue from the frontend if that would help?

    The custom field code related to the images field:

    [
                    'id'               => 'card_images',
                    'name'             => 'Enter the Images',
                    'type'             => 'image_upload',
                    'force_delete'     => false,
                    'max_file_uploads' => 50,
                    'max_status'       => false,
                    'image_size'       => 'medium',
                    'hidden' => [ 'card_type', '!=', 'images' ] 
    ],

    The full code - https://pastebin.com/JPd3m7V9

    in reply to: How to clone posts / populate form based on other posts #35382
    Sam UnderwoodSam Underwood
    Participant

    Rephrasing it:
    How do I use get_post_meta and add_post_meta with group subfields?

    in reply to: How to clone posts / populate form based on other posts #35363
    Sam UnderwoodSam Underwood
    Participant

    That wouldn't work for this case.

    I have a code that's almost working. It's able to clone every field except for groups.

    Here's how it's looking like so far:

    // duplicate all post meta
    $post_meta = get_post_meta( $post_id );
    if( $post_meta ) {
    	foreach ( $post_meta as $meta_key => $meta_values ) {
    		foreach ( $meta_values as $meta_value ) {
    			add_post_meta( $new_post_id, $meta_key, $meta_value );
    		}
    	}
    }

    How could I improve this so it'll also be able to go through the subfields?

    in reply to: JS before submitting form #34553
    Sam UnderwoodSam Underwood
    Participant

    Hi Long.
    I wouldn't like to force the user to do an extra click. They won't even see the image at this point, just the "live preview".
    I also thought about hiding the submit button, which might end up being the solution, although I don't like it very much.
    Thanks anyway.

Viewing 7 posts - 1 through 7 (of 7 total)