Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 4,156 through 4,170 (of 4,839 total)
  • Author
    Posts
  • Long NguyenLong Nguyen
    Moderator

    Hi,

    Regarding jQuery version: Meta Box and extensions are compatible with the newest version of jQuery 3.5.1 but it's not encouraged because of WordPress core use 1.12.4, using the newest version of jQuery might break some plugins/themes and it also breaks the Meta Box's JavaScript function.

    As you can see the green success message is completely wrong positioned.
    Therefore I would like to hide this message and create my own message using jQuery…
    So I am able to position/style the success or error messages in a way the design requires it.

    It looks so weird when the form submitted and the field still shows next to the confirmation box. Could you please share the code which creates the field and shortcode to show the frontend form?

    I thought I can show the results inside the field (like multi-select field)

    The field autocomplete helps you to select an option from the list and show below the field, you can select other options after. If you want to show like the multi-select, please use the field select_advanced.

    Can I use an external submit button and hide the one used inside MB (e.g. for design reason) and using jQuery for submit function (if please show a simple example).

    Yes, you can create a custom button that has ID custom-submit then use this JavaScript code to hide the form submit button and trigger click this submit button when clicking the custom button.

    jQuery(document).ready(function($) {
        $('.rwmb-form-submit button').hide();
    
        $('body').on('click', '#custom-submit', function() {
            $('.rwmb-form-submit button').trigger('click');
        });
    });
    in reply to: Beginner with no php knowledge #22385
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Maybe the condition has_post_thumbnail() && $shoppingcart_display_page_single_featured_image == 0 returns false so it does not run the code.

    You can try to add the code after the <article> tag, just like

    <article id="post-<?php the_ID(); ?>" <?php post_class();?>>
        <div class="entry-meta">
            <?php echo rwmb_meta( 'prefix-Neck' ) ?>
        </div>
    ...
    Long NguyenLong Nguyen
    Moderator

    Hi there,

    > hide the standard success or error messages (on MB-form-level and on single field level)

    What is the success and error message? We can simply hide the messages with some custom CSS code without touching other complicated PHP code.

    > catch the values with jQuery script (please create a small/simple example)

    I've created three number fields with the corresponding ID: width, length, square_meters. Using a small Javascript code to get two fields value and set the square value for the field square_meters.

    jQuery(document).ready(function($) {
        $('body').on('keyup', '#width, #length', function() {
            var width = $('#width').val();
            var length = $('#length').val();
            var square_meters = width * length;
            $('#square_meters').val(square_meters);
        });
    });

    See more in my screen record https://www.loom.com/share/568c0be8096542c3bb05e2eb3fa6f75c.

    > Which jQuery is needed (frontend/backend) to work with metabox?
    What happens if I change WordPress to the newest version?

    Meta Box uses the jQuery version depend on WordPress core 1.12.4 when enqueueing the script file, you can just use array( 'jquery' ) for the $deps parameter.

    For more information, please follow the documentation.
    https://developer.wordpress.org/reference/functions/wp_enqueue_script/#comment-content-276

    in reply to: Beginner with no php knowledge #22380
    Long NguyenLong Nguyen
    Moderator

    Hi Marie,

    You simply show the field's value in the loop while{...}, just an entry meta. The code should be:

    <div class="entry-meta">
        <?php echo rwmb_meta( 'prefix-Neck' ) ?>
    </div>
    in reply to: MB Custom Table in a multisite environment #22378
    Long NguyenLong Nguyen
    Moderator

    Hi,

    The plugin MB Custom Table also works in the multisite environment. If you use the phpMyadmin to create a table, please follow the notes to make the custom field works with that table.
    https://docs.metabox.io/extensions/mb-custom-table/#using-existing-tables.
    https://docs.metabox.io/extensions/mb-custom-table/#notes

    in reply to: Relationship between category and tag taxonomies #22364
    Long NguyenLong Nguyen
    Moderator

    Hi,

    The field taxonomy only supports to show the list of taxonomies with settings, not support filtering by another field's value.

    If a section (s) only belongs to one course, I think you can add the section as sub-courses (hierarchical). Then use the field type select_tree or checkbox_tree to select a section base on a course.

    in reply to: Multilingualpress compatibility? #22361
    Long NguyenLong Nguyen
    Moderator

    Hi,

    It's a premium plugin so I have not checked the compatibility with this plugin before. Could you please share a copy of it? I will create a feature request for the developer team to cover this case in a future update.

    You can also use the WPML plugin to translate your site and custom fields, it's compatible with Meta Box. Follow this article for more information https://metabox.io/translate-custom-fields-with-wpml/.

    in reply to: Input values not shown in back-end #22350
    Long NguyenLong Nguyen
    Moderator

    Hi,

    I think you can load in two separate folders, one for Meta Box plugin only, one for other extensions. It also needs to create two files composer.json and run it twice. Then easy to check and require the file autoload.php.

    if( ! class_exists( 'RWMB_Loader' ) ) {
        require 'meta-box/vendor/autoload.php';
        // code goes here
    }
    
    if ( class_exists( 'RWMB_Loader' ) ) {
        require 'extensions/vendor/autoload.php';
        // code goes here
    }
    in reply to: Problem with MB Frontend Submission and wp multisite #22349
    Long NguyenLong Nguyen
    Moderator

    Hi,

    We have released a new version 1.7.4 of the MB User Profile extension to cover this issue. Please update it and let me know how it goes.

    in reply to: Can I specify the format of contents field in frontend? #22341
    Long NguyenLong Nguyen
    Moderator

    Hi Eddy,

    Please follow this tutorial to know how to create a custom field WYSIWYG and replace the content of the default editor of WordPress. You can change to the field textarea as you want.

    https://docs.metabox.io/save-wysiwyg-content-post-content/

    in reply to: Code not working with updated version #22340
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Because the helper function rwmb_meta() runs after the filter hook rwmb_meta_boxes so you can use the function get_option() to get settings page value inside the function callback.

    $allergens = get_option( 'options' )['list'];

    in reply to: Compatible with Blocks ? #22333
    Long NguyenLong Nguyen
    Moderator

    Hi,

    The extension MB Yoast SEO Integration only works with single fields (not in a Group or a Block). We are trying to make it works with Group and Block in the future update.

    Thank you.

    in reply to: Input values not shown in back-end #22330
    Long NguyenLong Nguyen
    Moderator

    No, the autoloader is the must use. You should check class exists before requiring the file autoloader.

    if( ! class_exists( 'RWMB_Loader' ) ) {
        require 'vendor/autoload.php';
        // code goes here
    }
    in reply to: Problem with MB Frontend Submission and wp multisite #22328
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Please try to upload different images to check this issue again. Also, share the image file project-placeholder.png, I will try to upload it on my end. Maybe there is a problem with this file or it was broken.

    in reply to: Input values not shown in back-end #22326
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Any themes or plugins can use the Meta Box as a library so if you also create your plugin and use the Meta Box, please check it if exist before running other code.

    if( ! class_exists( 'RWMB_Loader' ) ) {
        // code goes here
    }
Viewing 15 posts - 4,156 through 4,170 (of 4,839 total)