Custom Fields
Re-Envisioned
Support Meta Box Builder Hyperlink url field outputs strange code Reply To: Hyperlink url field outputs strange code

#13472

Anh Tran
Keymaster

Hi Hein,

You have 2 cloneable fields, so when you use the shortcode to output, each of them will output in a unordered list.

To fix this, please use this PHP code instead of shortcode:

$texts = rwmb_meta( 'text_1' );
$urls = rwmb_meta( 'url_1' );
if ( ! empty( $texts ) ) {
    echo '<ul>';
    foreach ( $texts as $k => $text ) {
        echo "<li><a href='{$urls[$k]}'>{$text}</a></li>";
    }
    echo '</ul>';
}