Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 1,891 through 1,905 (of 3,708 total)
  • Author
    Posts
  • Anh TranAnh Tran
    Keymaster

    Hi, to combine values of 2 fields when saving, please use this snippet:

    add_action( 'rwmb_after_save_post', function( $post_id ) {
        if ( isset( $_POST['field_1'] ) && isset( $_POST['field_2'] ) ) {
            $value = $_POST['field_1'] . $_POST['field_2'];
            update_post_meta( $post_id, 'field_combine', $value );
        }
    } );

    This snippet combines the values of field_1 and field_2 into field_combine.

    To add JS to a meta box, please use this snippet:

    add_action( 'rwmb_enqueue_scripts', function() {
        wp_enqueue_script( 'your-script', 'https://url-to-your-js-file', array( 'jquery' ), '', true );
    } ):
    in reply to: text-domain question #10891
    Anh TranAnh Tran
    Keymaster

    Hi,

    The text domain is used for translating the labels when you setup a multilingual website. If your website is not multilingual, you can skip it (by entering any value). Read more about it here.

    in reply to: control posts comments with customfields on or off #10882
    Anh TranAnh Tran
    Keymaster

    Hi,

    Basically, the snippet change the post data before it's saved to the database. In this case, it set the comment status to closed for all submitted posts.

    If you want to make a checkbox for toggling comment status, you can add a checkbox field to the meta box and change the condition to something like this:

    // change
    // if ( 'meta-box-id' == $config['id'] ) {
    // to
    if ( 'meta-box-id' == $config['id'] && !empty( $_POST['checkbox_id'] ) ) {
    Anh TranAnh Tran
    Keymaster

    Hello,

    Can you please give me more details on combining two fields into one? Do you mean combining the values when saving?

    in reply to: cant add metabox for custom post types with mb builder #10880
    Anh TranAnh Tran
    Keymaster

    Hi,

    This happens with an old date metabox that i created

    Can you check the status of those meta boxes? Make sure they're published. You can check in the phpMyAdmin as well.

    And i try to import metabox to a new fresh install but i cant. After try to import i am gettiong error like this: Cannot load meta-box-import.

    Did you use the export/import functionality from the Builder?

    Anh TranAnh Tran
    Keymaster

    I got it. I was looking for the std of text_list field.

    By the way, the std is used only when the post hasn't been saved. Once it's saved, the values are stored in the DB and will be used next time when page loads.

    Do you see that happen with new posts?

    in reply to: select_tree for hierarchical taxonomies broken #10863
    Anh TranAnh Tran
    Keymaster

    Hi Charlin, I've just fixed the bug. I'll release new version now.

    Anh TranAnh Tran
    Keymaster

    Hi, I don't see you set std attribute for the field?

    in reply to: Conditional Logic Not Working #10861
    Anh TranAnh Tran
    Keymaster

    The easiest way is just set their IDs like: prefix-text and prefix-radio. Please just don't make something like field-one and field-one-two.

    I'm working on fixing this bug. Until then, this is the only way to get rid off the bug.

    in reply to: Select field is not working from version 4.15.0 #10859
    Anh TranAnh Tran
    Keymaster

    Hi,

    Thanks for your report. I've just fixed it.

    in reply to: Conditional Logic Not Working #10858
    Anh TranAnh Tran
    Keymaster

    Hi,

    The problem is the plugin doesn't handle very well the case when a field's ID contains another field's ID. In this case the ID of the input contains the ID of the radio field. The plugin make some guests to find the correct elements. And in this case, it gets the wrong elements 🙁

    To prevent this bug, please set the IDs so no one contains another.

    in reply to: Front-end validation messages #10857
    Anh TranAnh Tran
    Keymaster

    Hi Jason,

    Any reason for using the validation library for custom rules? Because the plugin already has it in the core. And you can just set the rules and messages.

    in reply to: How to populate a select box using JSON #10841
    Anh TranAnh Tran
    Keymaster

    Hi Marcel, unfortunately it's not possible for now. I'm thinking a better way to enter options for the fields in the Builder. Probably via a textarea instead of many label/value pairs as it is now.

    Update: a new way to enter options is available. Please update the Builder and take a look at this instruction video:

    https://youtu.be/cTsctgPbr-g

    in reply to: Export And Import #10840
    Anh TranAnh Tran
    Keymaster

    Hi Marcel,

    Unfortunately, it's not possible at the moment. The builder supports export and import for meta boxes created by the plugin only.

    in reply to: Form Not Showing #10839
    Anh TranAnh Tran
    Keymaster

    Hi Marcel,

    Please send me the link via Contact page.

    The tabs is showing means the form is rendered. It might be an issue with settings of the meta boxes.

Viewing 15 posts - 1,891 through 1,905 (of 3,708 total)