Call to undefined function rwmb_meta()

Support General Call to undefined function rwmb_meta()

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #4771
    yumikomyumikom
    Participant

    Hi,

    I tried update Metabox 4.10. WordPress ver.4.7.
    But some error occurred.

    Error is "Call to undefined function rwmb_meta()" in custom post listing page.
    An error occurs by both of "Administration Screen" and front page.

    It was update several web sites, but an error occurs only by 1 web site. This site sets metabox by a file,builder isn't being used.

    #4772
    Anh TranAnh Tran
    Keymaster

    Hi Yumikom,

    Maybe the theme or the plugin you're using has a call to the function "rwmb_meta()" when the Meta Box plugin is not loaded (or activated). It's better to change the code to:

    if ( function_exists( 'rwmb_meta' ) ) echo rwmb_meta( 'field_id' );

    If your field is a simple field (like text or textarea), you should use get_post_meta(), like this:

    echo get_post_meta( get_the_ID(), 'field_id', true );

    rwmb_meta() is just a wrapper of get_post_meta. Using get_post_meta might give you a better performance.

    #4793
    yumikomyumikom
    Participant

    Hi Tran,

    It was my easy mistake.
    I'm thankful for your quick support.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Call to undefined function rwmb_meta()’ is closed to new replies.