How to display Metabox.io image in Gutenberg?

Support General How to display Metabox.io image in Gutenberg?Resolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #38529
    UnakritiUnakriti
    Participant

    Hi Support,

    I am using the following code to insert a custom single-image field in WordPress Posts.

    <?php
    add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' );
    
    function your_prefix_function_name( $meta_boxes ) {
        $prefix = '';
    
        $meta_boxes[] = [
            'title'   => __( 'Post Pin', 'your-text-domain' ),
            'id'      => 'post-pin',
            'context' => 'side',
            'closed'  => true,
            'fields'  => [
                [
                    'name'              => __( 'Title Pin', 'your-text-domain' ),
                    'id'                => $prefix . 'title_pin',
                    'type'              => 'single_image',
                    'label_description' => __( 'Post Pin for Pinterest', 'your-text-domain' ),
                    'force_delete'      => true,
                ],
            ],
        ];
    
        return $meta_boxes;
    }

    After this, I am using WP Stackable's image block to display the image. But it is not working - simply displays a blank image container.

    Any solution please?

    Kind regards,

    #38535
    Long NguyenLong Nguyen
    Moderator

    Hi,

    In case of using a third-party builder plugin, please reach out to them if you have any issues with installation, configuration, compatibility, or usage.
    Refer to our support policy https://metabox.io/support/topic/support-policy/

    Or you can create your own custom block with MB Blocks to display the image custom field. Read more on the documentation https://docs.metabox.io/extensions/mb-blocks/

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.