Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 871 through 885 (of 3,708 total)
  • Author
    Posts
  • in reply to: Seeing an Uncaught TypeError with twig in AIO 1.9.2 #15620
    Anh TranAnh Tran
    Keymaster

    Hi Doug,

    Twig is added to MB Builder 3.1.0, which is available in the AIO 1.9.2. I think you might be right about the conflict with the 2FAS Light plugin. Do you see any error if you disable 2FAS Light or MB Builder?

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

    I understand. However, there are some cases where people really want to enter script, like a textarea field for entering header / footer code (in a page settings).

    I just want to provide the maximum flexibility to users, while developers still can restrict the content if they want. That's how a library should do. It's the same as the Customizer API where developers still have to define their own sanitize callback.

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

    Hi David,

    Making a whitelist of HTML tags might be tricky, since there are a lot of them. For example, if you have a textarea/wysiwyg field, then it nearly impossible to define those tags. Besides, I want to offer flexibility to developers and let them decide what need to be sanitized.

    I'll add sanitize_callback parameter to the field settings. So developers can decide what and how to sanitize value.

    in reply to: Color picker rwmb arguments #15597
    Anh TranAnh Tran
    Keymaster

    Yes, that's right. If you need to pass the value for the 3rd parameter, you have to pass a value for the 2nd parameter. It's just how params in PHP function work.

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

    Hi Rao and David,

    The plugin sanitize values for some field types only (file_input, email, url, oembed, checkbox and switch). You can see the code for that here. For other fields, to let users able to enter some HTML, we don't force a sanitize callback. But you can sanitize the value with this code:

    add_filter( 'rwmb_text_sanitize', 'sanitize_text_field' );
    
    add_filter( 'rwmb_{$field_type}_sanitize', 'your_sanitize_callback' );
    Anh TranAnh Tran
    Keymaster

    Oops, I forgot to pass the param to the render callback function. Thanks for your help!

    in reply to: How to move a core block into another category? #15590
    Anh TranAnh Tran
    Keymaster

    Hi, please try the block_categories filter.

    Here is the docs:

    https://developer.wordpress.org/block-editor/developers/filters/block-filters/#managing-block-categories

    Here is a good tutorial: https://getwithgutenberg.com/2019/04/creating-a-block-category/

    Both resources say about adding categories. I'm not sure if it supports removing core categories. Please just try.

    in reply to: taxonomy field not saving terms for the custom post #15588
    Anh TranAnh Tran
    Keymaster

    Hi Akram,

    Sorry to make you feel like that. What I meant is that's the default behavior of the fields.

    You still can change the behavior with the plugin action, like this:

    add_action( 'rwmb_after_save_post', function( $post_id ) {
        $group = get_post_meta( $post_id, 'group_id', true );
        $terms = $group['terms'] ?? [];
    
        wp_set_post_terms( $post_id, $terms, 'your_taxonomy' );
    } );
    in reply to: taxonomy field not saving terms for the custom post #15584
    Anh TranAnh Tran
    Keymaster

    Hi Akram,

    If you want to set post terms, you have to move the taxonomy field outside the group. You can use MB Conditional Logic to hide the field if you want. If you still need to keep it inside a group, then there's no way to achieve that.

    in reply to: Custom block not saving #15569
    Anh TranAnh Tran
    Keymaster

    Hi Alex, this is the screenshot of the email: https://imgur.elightup.com/0muIt7y.png. I sent from [email protected]. Can you check that again?

    Anh TranAnh Tran
    Keymaster

    Hi again,

    I've just fixed this bug, can you try the development on Github?

    in reply to: Custom block not saving #15565
    Anh TranAnh Tran
    Keymaster

    Hi Alex,

    Thanks a lot for your video and code. I've sent you an email with a fix for MB Blocks. Please try it along with the updated version of Meta Box on Github and let me know how it goes.

    in reply to: taxonomy field not saving terms for the custom post #15562
    Anh TranAnh Tran
    Keymaster

    Hi Akram,

    Did you put the taxonomy field in a group? Only in that case, the taxonomy terms are saved in the group's meta value and don't set the post terms.

    in reply to: Composer install #15561
    Anh TranAnh Tran
    Keymaster

    Yes, it's:

    'meta-box/mb-blocks': 'dev-master'
    
    in reply to: Metabox labels not showing #15560
    Anh TranAnh Tran
    Keymaster

    Hi,

    When the style for settings page is set no-boxes, meta boxes' titles won't show because there's no box wrapper anymore. It's the expected behavior.

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