Custom Fields
Re-Envisioned
Support MB Blocks Anchor not saving

  • Creator
    Topic
  • #15841
    Resolved Johannes Gross
    Participant

    Love this extension. Great job!

    While working with it, I noticed that the anchor does not save and is not available through the callback attribute.

    Here is a snippet of my code:

    $meta_boxes[] = array(
                    'id'         => 'twt-gallery-block',
                    'title'      => 'TWT Gallery',
                    'type'            => 'block',
                    'icon'            => 'layout',
                    'category'        => 'layout',
                    'render_callback' => array($this, 'render_block'),
                    'supports' => array(
                        'anchor' => true,
                        'customClassName' => true,
                    ),
                    'fields' => array(
                        array(
                            'name' => 'Images',
                            'id'   => 'images',
                            'type' => 'image_advanced',
                        ),
                        array(
                            'name' => 'Row Height (px)',
                            'placeholder' => '300',
                            'id'   => 'row_height',
                            'type' => 'number',
                        ),
                        array(
                            'name' => 'Displayed At Start',
                            'placeholder' => '20',
                            'id'   => 'displayed_at_start',
                            'type' => 'number',
                        ),
                        array(
                            'name' => 'Load More Increments',
                            'placeholder' => '10',
                            'id'   => 'load_more_increments',
                            'type' => 'number',
                        ),
                        array(
                            'name' => 'Last Row',
                            'id'   => 'last_row',
                            'type' => 'select',
                            'options' => array(
                                'justify' => 'justify',
                                'nojustify' => 'don\'t justify'
                            )
                        ),
                    )
                );
    

    Not urgent…

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #15862
    Anh Tran
    Keymaster

    Hi Johannes,

    Thanks for your feedback. This is a Gutenberg problem and have fixed in this pull request. I think it’ll be available in WordPress 5.2.3.

    #15873
    Johannes Gross
    Participant

    Great! Thank you for your reply and for staying on top of this!

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