Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 1,876 through 1,890 (of 3,702 total)
  • Author
    Posts
  • in reply to: Conditional Logic and Gutenberg #10922
    Anh TranAnh Tran
    Keymaster

    Hello,

    The Gutenberg plugin changes HTML markup and breaks the current code. We haven't updated the code for post format yet. Gutenberg can change the markup anytime until it's stable (merged into core). We'll keep working on that to make the conditional logic works.

    in reply to: Builder Questions #10921
    Anh TranAnh Tran
    Keymaster

    Hi Michael,

    We're working on this feature. When it's done, you'll be able to copy & paste the options into a textarea. No need to enter each option one by one.

    The tab requires MB Tabs extension. When you activated the extension, you can add tabs like in this screenshot:

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

    And they will display like this:

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

    Anh TranAnh Tran
    Keymaster

    Thanks a lot for your code! It really helps. I've fixed it on Github.

    in reply to: Composer update, nothing to update? #10919
    Anh TranAnh Tran
    Keymaster

    Hi Mauro,

    Maybe Composer caches the packages. I always run these 2 commands together:

    composer clear-cache && composer install

    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?

Viewing 15 posts - 1,876 through 1,890 (of 3,702 total)