Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 1,906 through 1,920 (of 3,958 total)
  • Author
    Posts
  • Anh TranAnh Tran
    Keymaster

    Hi Marge,

    I've just tested with The Events Calendar plugin and I see all custom fields for events are showing in the Themer. Here is my screenshot:

    https://imgur.elightup.com/K6Y6fAa.png

    How did you set it up?

    in reply to: Help with Background Field #10917
    Anh TranAnh Tran
    Keymaster

    Hi Thomas,

    The background field saves details into an array. If you use the helper function rwmb_meta() to get its value - you'll get an array.

    To get the generated CSS for the background, please use the function rwmb_the_value().

    This is the sample code:

    $bg = rwmb_meta( 'field_id' );
    echo $bg['color']; // Output a single background attribute
    
    // Get CSS for background
    $css = rwmb_the_value( 'field_id', '', '', false );
    echo $css;
    Anh TranAnh Tran
    Keymaster

    List of actions are available in the documentation.

    To add small HTML and JS just below a field, you can use the after param of the field. See field settings for more details.

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

    Hey guys. Thanks a lot for your details. Let me check Jason's code first. Looks like it's more complicated than I thought.

    Anh TranAnh Tran
    Keymaster

    Hi Dan,

    Can you please give me more details on how the $config can include all username, password? I'm quite confused how $config is related to the validation banner.

    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.

Viewing 15 posts - 1,906 through 1,920 (of 3,958 total)