Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 1,156 through 1,170 (of 3,707 total)
  • Author
    Posts
  • in reply to: moving to MB custom tables #14378
    Anh TranAnh Tran
    Keymaster

    Hi Dave,

    Please try this script (put it in your functions.php file and go to this URL: yourdomain.com?action=migrate):

    https://pastebin.com/BPXTEy6H

    The idea of the script is:

    • Make sure it runs only when the URL contains ?action=migrate to avoid running the script on every page load.
    • Query all the posts that need to migrate the data. You should modify the query to get your correct posts.
    • For each post, get the old meta value for each field. Note about the value format to see if it's an array or simple string.
    • Insert the values into the new table. If the value is an array, it need to be serialized.

    The script comes directly from my mind without testing, so please check it first.

    Anh TranAnh Tran
    Keymaster

    Hi Sergio,

    There are 2 ways to do that as you already described in your question:

    1. Set the rule for each field in the meta box B, or
    2. Set the rule for the whole meta box B.

    I think the 2nd solution is better and cleaner. This rule should be put in the settings of the meta box B:

    'hidden' => array( 'radio_field_id', '=, 'radio_1' ),

    The rule should specify the field ID, not the meta box ID (since the meta box is just a wrap of fields).

    in reply to: Image in Group #14376
    Anh TranAnh Tran
    Keymaster

    Hi William,

    It's necessary to check if a group has sub-values for title and image. Please try this code:

    <?php
    $product_colour = rwmb_meta( 'product-colour' ); // ID of the group
    if ( ! empty( $product_colour ) ) {
        if ( ! empty( $product_colour['title'] ) ) {
            echo '<h3>', $product_colour['title'], '</h3>';
        }
        if ( ! empty( $product_colour['image'] ) ) {
            $image = RWMB_Image_Field::file_info( $product_colour['image'], ['size' => 'thumbnail'] );
            echo '<img src="', $image['url'], '">';
        }
    }
    ?>
    in reply to: Problem when using Groups with Tabs #14375
    Anh TranAnh Tran
    Keymaster

    Hi Neil,

    I've just answered you in another topic. The rule here is: you can add only one tab navigation, no nesting tabs. But for groups, you can add as many groups with any nesting level.

    To make things cleaner on the edit screen, I'd suggest using collapsible groups.

    in reply to: Ignore saved state on REST API #14374
    Anh TranAnh Tran
    Keymaster

    Due to the nature of group, a private key is the only way I found to store the current state of a collapsible group, especially with nested groups.

    I'll make a commit for the REST API extension to strip it from the output.

    Update: the fix is available in the version 1.3.4.

    Anh TranAnh Tran
    Keymaster

    Hi Austin,

    This is a nice improvement. I've just looked at the solution on SE and I think it's quite complicated. Working with WP's Media Library is not easy! Our code for the media fields are not simple, either.

    I'll make a note on this and see if I can improve it. Thanks for your suggestion.

    in reply to: Stacking / Nesting Elements #14372
    Anh TranAnh Tran
    Keymaster

    Hi Neil,

    You can put groups inside groups without problems. Group supports nesting to unlimited levels.

    However, tabs are not nesting. So you need to use only one tab style, either on top or left.

    in reply to: Seems error in meta box plugin #14328
    Anh TranAnh Tran
    Keymaster

    Hi Calpaq,

    I've just tested again and don't see the problem. Can you make a screenshot or video?

    in reply to: qtranslate X plugin not working with metabox.io #14327
    Anh TranAnh Tran
    Keymaster

    Hi,

    qTranslate X plugin seems to be abandoned from its author for the last 3 years. I personally don't think it's a good option for a multilingual website. Unfortunately, we don't have an option to make Meta Box work with qTranslate X yet.

    in reply to: Can't Get Image Field to Display Image via Shortcode #14326
    Anh TranAnh Tran
    Keymaster

    Hi Mark,

    Glad that the shortcode works! I'll check the integration with BB. When it's fixed, I'll update the AIO.

    Should I expect for this fix to be in the next repository update you make?

    Yes. I'll probably use version 4.17.4, so that will overwrite your modified 4.17.3.1 version.

    Anh TranAnh Tran
    Keymaster

    Hi Sergio,

    Yes, it can be done with a condition like this:

    [
        'type' => 'text',
        'id' => 'field_id',
        'name' => 'Text field',
        'disabled' => ! is_admin(), // This disables editing in the front end.
    ]
    Anh TranAnh Tran
    Keymaster

    Hi Sergio,

    The meta_key and meta_value in the query_args will tell the plugin to filter users by WordPress custom fields, e.g. user meta. They don't handle the value in the custom table.

    in reply to: Can AIO activate extensions network-wide in multisite? #14323
    Anh TranAnh Tran
    Keymaster

    Hi Denny,

    Yes, the plugin can be network activated, just like other plugins. However, the settings are saved per site. We have a request make it store settings for the whole network. It's still on our plan.

    in reply to: moving to MB custom tables #14322
    Anh TranAnh Tran
    Keymaster

    Hi Dave,

    I'm afraid you have to write a custom script to migrate existing data from custom fields to custom tables. The plugin doesn't auto transfer data for you.

    in reply to: Limit the number of "favorites" in radio buttons #14321
    Anh TranAnh Tran
    Keymaster

    Ah, I forgot to tell you that the code above only add or remove disabled attribute for the button. The disabled makes the button un-clickable. However, it doesn't change the style. You might need to add something like this to the theme's CSS:

    button[disabled] { background: #999 }

Viewing 15 posts - 1,156 through 1,170 (of 3,707 total)