Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 4,696 through 4,710 (of 4,839 total)
  • Author
    Posts
  • in reply to: Switch field value always true in admin columns #19354
    Long NguyenLong Nguyen
    Moderator

    Hi,

    On my local site, the field switch show Off value on the custom admin column as well, please see my screenshot https://cl.ly/825833f17303.

    Could you please deactivate then re-activate all plugins and recheck the problem?

    Long NguyenLong Nguyen
    Moderator

    Hi,

    It's the feature of Group field Database optimization of sub-fields for reduced bloat. If every field nested in Group has all property saved, it will increase the size of the database and slow down your site. That's why Group only saves necessary information of the sub-field.

    Hope that makes sense.

    in reply to: Switch fields always saves as true (1) #19345
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Could you please let me know the data type of column which saves switch value? I'm just using type INT and it saves the value 0 and 1 as well, see my screenshot https://cl.ly/54c9e116ec61

    Here is the sample code https://pastebin.com/nvMFeqKD

    in reply to: Fields become empty. #19338
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Could you please update the latest version of Meta Box to v5.2.10 and MB Group to v1.3.10 or MB AIO to v1.11.6 then check the problem again?

    Long NguyenLong Nguyen
    Moderator

    Hi,

    After removing the default featured image and use the single image field with the ID _thumbnail_id to save value for this meta key, it works as well with the latest version of Meta Box v5.2.10. Please try again with my sample code

    // Remove the featured image
    add_action( 'init', function () {
        remove_post_type_support( 'post', 'thumbnail' );
    } );
    
    add_filter( 'rwmb_meta_boxes', function ( $meta_boxes ) {
        // Get the current post thumbnail and set as the default value for the single image field.
        $post_id = filter_input( INPUT_GET, 'post', FILTER_SANITIZE_NUMBER_INT );
        $post_thumbnail = get_post_meta( $post_id, '_thumbnail_id' );
    
        $meta_boxes[] = [
            'title'      => 'Featured image',
            'post_types' => 'post',
            'fields'     => [
                // Register a single image field
                [
                    'type' => 'single_image',
                    'id'   => '_thumbnail_id', // This is the must!
                    'name' => 'Fake featured image',
                    'std'  => $post_thumbnail,
                ],
            ],
        ];
    
        return $meta_boxes;
    } );

    Let me know how it goes.

    Long NguyenLong Nguyen
    Moderator

    Hi,

    A new update has been released, we've added a new option show_if_user_can lets the form still shows the current user has a proper capability. This option is also updated in the documentation, please update the extension and check it out.

    in reply to: Ajax Form Submission Isn't Working #19327
    Long NguyenLong Nguyen
    Moderator

    Hi Jason,

    Please update the new version of MB AIO to v1.11.6 or MB Frontend Submission to v2.2.1 then check the problem again. Also, if you want a field that is required, please use the Validation module https://docs.metabox.io/validation/ to work with Ajax setting.

    Let me know how it goes.

    in reply to: Bug with most recent update: Error from WooCommerce Log #19326
    Long NguyenLong Nguyen
    Moderator

    Hi,

    You can go to Admin Dashboard -> Meta Box -> Taxonomies -> Edit a taxonomy -> Click the button Get PHP Code to get the code and paste it on the file functions.php or using Code Snippets plugin to create a taxonomy after deactivating MB AIO plugin, see my screenshot.

    But I also create a custom post type, taxonomies with MB AIO and admin columns for fields, taxonomies but the button Place Order on the Checkout page still works as well. Could you please switch to the default theme of WordPress (Twenty Nineteen) then check the problem again?

    Long NguyenLong Nguyen
    Moderator

    Hi,

    If the field is nested in a group, it will be serialized and saved in the database such as {"image_advanced":["1957","1956","1955"]}. For some special fields, only the ID will be saved and you need to use some helper functions to get the URL of the image by the ID. For more information, please follow this documentation
    https://docs.metabox.io/extensions/meta-box-group/#special-fields

    in reply to: How to store WordPress Posts in a Custom Table? #19323
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Please keep the eyes on updates. It's on its way.

    Thank you, and have a beautiful day.

    in reply to: Date field, timestamp problem ? #19307
    Long NguyenLong Nguyen
    Moderator

    Hi guys,

    Please update the new version of MB AIO to v1.11.6 or MB Group to v1.3.10 then check this problem again. Let me know how it goes.

    in reply to: Relational posts not showing in admin columns #19306
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Currently, we are researching and developing feature supports to change the value of Admin columns in Quick Edit. If you really want to make the admin columns editable, please try to use the plugin Admin Columns and their addon Meta Box Integration.

    Thank you.

    Long NguyenLong Nguyen
    Moderator

    Hi,

    Because the field group saves as a meta key in the database and serializes the value of all the fields nested in, so you should use the filter rwmb_settings_test_video_list_value to modify the value of the field group and use foreach to loop through the array of the clone. The code would be

    add_filter('rwmb_settings_test_video_list_value', 'settings_test_autoinc_value', 10, 3 );
    function settings_test_autoinc_value($new, $field, $old) {
        // Loop through array of clone
        foreach ($new as $key => $value) {
            // check if the field video is empty
            if (empty($value['settings_test_video_id'])) {
                // set the ID for each field
                $new[$key]['settings_test_video_id'] = 4222;
            }else {
                $new[$key]['settings_test_video_id'] = 21223;
            }
        }
        
        return $new;
    }
    in reply to: TypeError: logics is undefined #19301
    Long NguyenLong Nguyen
    Moderator

    Hi Brian,

    Could you please share your code which uses conditional logic? I will check it on my end.

    in reply to: Image field - image URL via MB Rest API? #19299
    Long NguyenLong Nguyen
    Moderator

    Hi Amanda,

    The field image_advanced supports the property full_url to get the full URL of the image, see my screenshot https://cl.ly/9ee6bc157bd4

    For more information, please follow the documentation
    https://docs.metabox.io/fields/image-advanced/#template-usage

Viewing 15 posts - 4,696 through 4,710 (of 4,839 total)