Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 871 through 885 (of 3,958 total)
  • Author
    Posts
  • in reply to: metabox info #15699
    Anh TranAnh Tran
    Keymaster

    Hi,

    This is similar to what we've done in the MB REST API plugin. Please take a look at the plugin code to see how it's done.

    in reply to: Sanitization of Fields input #15698
    Anh TranAnh Tran
    Keymaster

    Hey guys,

    I added some sanitization callbacks. More will come later. The full code of the sanitization is here.

    This is the 1st step on this. Any feedback is welcomed.

    in reply to: Taxonomy fields not clonable? #15687
    Anh TranAnh Tran
    Keymaster

    Yes, that can be done with this filter:

    https://docs.metabox.io/actions/#rwmb_field_id_after_save_field

    add_action( 'rwmb_YOUR_FIELD_ID_after_save_field', function( $null, $field, $new, $old, $object_id ) {
        $term_ids = $new;
        if ( $field['clone'] ) {
            $term_ids = [];
            foreach ( $new as $clone_value ) {
                $term_ids = array_merge( $term_ids, $clone_value );
            }
        }
        wp_set_post_terms( $object_id, $term_ids, 'YOUR_TAXONOMY' );
    }, 10, 5 );
    in reply to: Migration Issue #15686
    Anh TranAnh Tran
    Keymaster

    Hi,

    Did you change the code for fields when migrating the site? That might be the problem. The structure of the meta box and fields need to be the same in the previous site.

    You can also try to var_dump the value (sometimes you need to unserialize it first if that's a group), to see the data structure. And verify that with the meta box/fields structure to make sure they match.

    in reply to: datepicker not showing on front end #15685
    Anh TranAnh Tran
    Keymaster

    I see. Removing the "content" from the shortcode breaks the date picker. I've just fixed it in this commit. Please try it. The new version is coming soon.

    in reply to: datepicker not showing on front end #15674
    Anh TranAnh Tran
    Keymaster

    Hi Mary,

    I've just checked and couldn't replicate the error. I recorded a video here:

    https://www.loom.com/share/b309930905274434abebd1ab3c7ef0ea

    Please take a look.

    If you still see the problem, please send me more details or a temporary admin account via the Contact form. I'll take a closer look to your site.

    in reply to: For loops in MB Blocks with MB Builder #15673
    Anh TranAnh Tran
    Keymaster

    This bug is fixed in version 1.0.3. New version for AIO will come a little later.

    in reply to: Choice fields filter not working on clonable field #15672
    Anh TranAnh Tran
    Keymaster

    Hi Ryan, this bug is fixed in this commit.

    in reply to: Choice fields filter not working on clonable field #15667
    Anh TranAnh Tran
    Keymaster

    Oh, I see the problem. After saving, only the 1st input has the filter working. I'll fix it now.

    in reply to: Taxonomy Advanced - display category thumbnail image #15666
    Anh TranAnh Tran
    Keymaster

    Hi Wojtek,

    If you're on a category/term page, then you can get the term id with get_queried_object_id(). You can also get full term object with get_queried_object().

    in reply to: datepicker not showing on front end #15665
    Anh TranAnh Tran
    Keymaster

    Hi Mary,

    Do you see any error in the browser console?

    in reply to: wp-config constant for license key #15664
    Anh TranAnh Tran
    Keymaster

    Hi Austin,

    This is a great idea. I'll work on this now.

    in reply to: Sanitization of Fields input #15663
    Anh TranAnh Tran
    Keymaster

    Hi Rao,

    I really appreciate your thoughts on this.

    I understand the need for default sanitization. And believe me, this is what I also want to add to the plugin.

    You also pointed out a very important point (point 1), which makes me not pushing the santization so hard. Meta Box is now actively used on 400k+ websites. Any change we make will affect these huge amount of websites. I can't notify the developers (there's no way to let them know because WordPress.org doesn't provide any way to contact to them). So, I decide to not implement a forced / opinionated sanitization at the moment. I have to be very careful about this.

    Another thing that people should consider is: Meta Box is not an end-user tools. It's a tool for developers which provides API. So there's nothing like Meta Box --> Users, but it's more like Meta Box --> Developers --> Users. Because of this, developers understand which kind of data they want their users to enter. And thus, a sanitization callback fits this situation.

    If you're building a new plugin / solution using Meta Box, why don't you implement this with just a few lines of code instead of depending the default sanitization which might not work smoothly in all cases?

    There are also a few things regarding sanitization in WordPress, that I think worth mentioning:

    • Admins can enter script and style in the post content, regardless the santiziation of wp_kses_post.
    • Customizer API requires (not strictly) developers to enter santiziation callback. If no sanitization callback, then what users enter will be used.
    • wp_insert_post doesn't do any sanitization for the content when inserting the post programmatically.

    Anyway, there is a default sanitization for some fields (email, url, file_input, checkboxes). For other fields, due to the nature of the complexity, I haven't implemented that. If you have any idea on which proper sanitization for each field type, please let me know.

    in reply to: MB Blocks not listed in AIO extension #15646
    Anh TranAnh Tran
    Keymaster

    Hi Georgina,

    The AIO plugin includes MB Blocks. Can you please check that again?

    in reply to: Sanitization of Fields input #15639
    Anh TranAnh Tran
    Keymaster

    I've added support for sanitize_callback here. Please try it and let me know if you need any improvement.

Viewing 15 posts - 871 through 885 (of 3,958 total)