• Resolved Grafico_Torino

    (@grafico_torino)


    Hi guys,
    I have a big problem with RWMB_Helper that not working anymore on WP 4.9.2.
    How can I fix it?

    I need to print field label before the value only when it’s filled, this is my actual code:

    <?php $value = rwmb_meta( ‘anno_inizio’ );
    if (!empty($value)) {
    $field = RWMB_Helper::find_field( ‘anno_inizio’ );
    echo $field[‘name’];
    echo ‘ ‘;
    echo $value;
    } ?>

    Thank you in advance.

Viewing 1 replies (of 1 total)
  • Plugin Author Anh Tran

    (@rilwis)

    Hi,

    Please don’t use the non-public API (which are not specified in the docs) as we might change in the future. We have removed RWMB_Helper class in the latest versions.

    To find the field settings, you can use this code:

    $field = rwmb_get_field_settings( $id );
    echo $field['name'];

    If you want to get the field settings for a specific post (note that same field IDs can be used for 2 different post types), then use this code:

    $field = rwmb_get_field_settings( $id, array(), $post_id );
    echo $field['name'];

    This function is available for the version on Github only (which will be merged into the ww.wp.xz.cn version in the next version). It’s an internal function and please use with care.

Viewing 1 replies (of 1 total)

The topic ‘RWMB_Helper problem!?’ is closed to new replies.