Custom Fields
Support MB Frontend Submission Add checkbox frontend and save meta

  • This topic has 2 replies, 2 voices, and was last updated 1 year ago by ben06.
  • Creator
  • #23994
    Resolved ben06

    I'm creating a reading check system :

    I created a metabox block (fields groups) with only one checkbox field.

    I want it to display on frontend if this metabox is used in back office.

    Then I want to save the meta (checked) when someone check it and keep the checkbox checked after refresh.

    Can someone help me?
    Thank you for your time.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
  • #24016
    Long Nguyen

    Hi Ben,

    The field checkbox helps you to create a checkbox on the backend when editing a post (or post type) then show the value on the frontend with the helper function rwmb_meta(). You can create a condition to show something on the frontend if the box is checked on the backend.

    $value = rwmb_meta( $field_id );
    // If field is checked.
    if ( $value ) {
        echo 'Checked';
        // Do something.
    // If field is unchecked.
    else {
        echo 'Unchecked';
        // Do something else.

    Thank you for your answer!

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