we found out that advanced type text-list is not working anymore
-
Hi,
We have been using Metabox custom meta plugin for years! But it stopped working. We found out on the advanced field type “text-list”
The field type “text-list” shows in the front end template. But it does not show the saved values in the block editor when loading a post. It is possible to save a new one entry, but it replaces al previously entered data. Also saving the post will erase all fields and values in the db. It is currently not possible for us to edit posts because this will erase all the text-list type custom meta. Unless you create a new field every time you save the post.
If we use chrome inspector to check the group, we see the following hidden entries with display set to “none” nad both fields are in the value property of the input, it seems like they are rendered completely wrong:
<div class="rwmb-clone rwmb-text_list-clone rwmb-sort-clone rwmb-clone-template" style=""><a href="javascript:;" class="rwmb-clone-icon"></a><label><span class="rwmb-text-list-label">Store</span> <input id="product-links-stores" class="rwmb-text_list" name="product-links-stores[0][]" aria-labelledby="product-links-stores-label" aria-describedby="product-links-stores-description" type="text" placeholder="name"></label> <label><span class="rwmb-text-list-url">URL</span> <input id="product-links-stores" class="rwmb-text_list" name="product-links-stores[0][]" aria-labelledby="product-links-stores-label" aria-describedby="product-links-stores-description" type="text" value="["Inprint","https:\/\/www.inprnt.com\/gallery\/example\/wave\/"]" placeholder="url"></label><a href="#" class="rwmb-button remove-clone" style="display: none;"><span class="dashicons dashicons-dismiss"></span></a></div>
I hope you can reproduce this and find a solution
wordpress version: 6.6.1
metabox 5.10.0this is the setup:
<?php
function product_links_get_meta_box( $meta_boxes ) {
$prefix = 'product-links-';
$meta_boxes[] = array(
'id' => 'product_links',
'title' => esc_html__( 'Product Links', 'textdomain' ),
'post_types' => array( 'portfolio' ),
'priority' => 'high',
'autosave' => false,
'fields' => array(
array(
'id' => $prefix . 'stores',
'type' => 'text_list',
'name' => esc_html__( 'stores', 'textdomain' ),
'desc' => esc_html__( 'Add external product links', 'textdomain' ),
'clone' => true,
'options' => array(
'name' => 'Store',
'url' => 'URL'
),
'add_button' => esc_html__( 'Add Store', 'textdomain' ),
),
),
);
return $meta_boxes;
}
add_filter( 'rwmb_meta_boxes', 'product_links_get_meta_box' );
- You must be logged in to reply to this topic.