Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 1,591 through 1,605 (of 3,702 total)
  • Author
    Posts
  • in reply to: Multiple Metabox array names #12354
    Anh TranAnh Tran
    Keymaster

    Hi Nakaiya,

    Yes, of course. But in the callback function of the rwmb_meta_boxes filter, please just use the variable $meta_boxes. It's an array of meta boxes. Each meta box has a different title.

    So, your code can be modified to this:

    add_filter( 'rwmb_meta_boxes', 'announcements_register_meta_boxes' );
    function announcements_register_meta_boxes( $meta_boxes ) {
        $prefix = 'announcements_';
        $meta_boxes[] = array(
            'id'         => 'announcements',
            'title'      => 'Announcements Meta',
            'post_types' => 'announcements',
    
            'fields' => array(
                // DATE
                array(
                    'name'       => __( 'Event Date - If nothing is entered here, the post publish date will be used', 'announcements_' ),
                    'id'         => "{$prefix}display_date",
                    'type'       => 'date',
                ),
    
            )
        );
        return $meta_boxes;
    }
    
    add_filter( 'rwmb_meta_boxes', 'register_meta_boxes' );
    function register_meta_boxes( $meta_boxes ) {
        $prefix = 'uu_';
        $meta_boxes[] = array(
            'id'         => 'uu_metabox',
            'title'      => 'My Metabox',
            'post_types' => 'post',
    
            'fields' => array(
                // DATE
                array(
                    'name'       => __( 'Event Date - If nothing is entered here, the post publish date will be used', 'announcements_' ),
                    'id'         => "{$prefix}display_date",
                    'type'       => 'date',
                ),
    
            )
        );
        return $meta_boxes;
    }
    Anh TranAnh Tran
    Keymaster

    Hi Saqib,

    I've just updated the extension to make it works with Gutenberg. However, there's some limitation in Gutenberg, it only supports the template and post_format rules. Other rules are still not supported and need to wait for update from Gutenberg. I'll update the extension when it's done.

    in reply to: exclude some posts from post query #12323
    Anh TranAnh Tran
    Keymaster

    Can you try re-save the meta box?

    in reply to: exclude some posts from post query #12320
    Anh TranAnh Tran
    Keymaster

    I forgot to change the version number on the website. Please try again.

    in reply to: Creating Custom Field - Telephone #12314
    Anh TranAnh Tran
    Keymaster

    Ah, you're using the MB Builder :). I was saying about using code.

    In MB Builder, to change the type, please go to Advanced tab, try add a custom attribute type with value tel.

    in reply to: exclude some posts from post query #12313
    Anh TranAnh Tran
    Keymaster

    It's now available in the AIO. Please update!

    in reply to: exclude some posts from post query #12291
    Anh TranAnh Tran
    Keymaster

    Just fixed this issue in the Builder, please update.

    in reply to: Is it possible to use Select2 in select_tree field type? #12290
    Anh TranAnh Tran
    Keymaster

    Hi Jefferson,

    Thanks for the suggestion. I'll put it on my note and will try to implement this.

    in reply to: How to put the select of select_tree in columns? #12289
    Anh TranAnh Tran
    Keymaster

    Hi Jefferson,

    Unfortunately, no. The whole "tree" is considered as a field, and it's to be put in a single column.

    in reply to: How to integrate my MB Custom Talbe with Algolia? #12288
    Anh TranAnh Tran
    Keymaster

    Hi Jefferson,

    I haven't integrated with Algolia. From what I've just read on its docs is you need to add objects to their database to make them index. They already have PHP library, so I think the process would be:

    • get the value from custom table,
    • use the library to add this value to their database.
    in reply to: Displaying Form Data as a visual chart #12287
    Anh TranAnh Tran
    Keymaster

    Hi Neil,

    As I answer in the other topic, showing the value of custom fields in a different way need some coding. In this case, you want to display in a chart or graph, then the steps will be:

    • Download a chart/graph library required CSS/JS. Depends on which library you use, the files are different.
    • Enqueue a chart/graph library's JS/CSS. This can be done in the theme with wp_enqueue_script and wp_enqueue_style.
    • Get the field values (via helper functions).
    • Output the values in the format required by the chart/graph library. If they required the data in JavaScript, you need to use wp_localize_script to enqueue the data.
    • Write some custom JS to initialize the graph/chart.

    That might sound complicated, but the whole process is just trying to pass the data of custom fields to the JS of the library. Depends on which library you use, the code might be different.

    in reply to: Using Field Values in Calculations - 2 questions #12286
    Anh TranAnh Tran
    Keymaster

    Hi Neil,

    Question #1 – how can I implement fields that recognize numerical input as a percentage? I am using the number field now….

    It actually doesn't. You need to write some description to the field to let users know it's a percentage.

    Question #2 – how do I perform calculations and then display the result?

    When you insert the code to the front end, please add some calculation before that:

    $value = rwmb_meta( 'percentage' );
    $value = $value / 100 * $another_field_value;
    echo $value;

    If you're using a page builder like Beaver Builder, I'd suggest writing a custom shortcode to put into a text module in BB. The shortcode might be like this (put in functions.php):

    add_shortcode( 'your_percentage', function( $atts, $content ) {
        $value = rwmb_meta( 'percentage' );
        $value = $value / 100 * $another_field_value;
        return $value;
    } );

    In a text module in BB, simply insert [your_percentage] and your result will appear.

    in reply to: Creating Custom Field - Telephone #12285
    Anh TranAnh Tran
    Keymaster

    Hi Neil,

    1. Yes, it's possible. Please just change the type from text to tel and you already have telephone field. It's actually a HTML5 input type and I already covered it here.

    2. The MB Builder could not be extended that way. If you create a new field type, it's available for coding only. It won't show in the Builder.

    Anh TranAnh Tran
    Keymaster

    Hi Saqib, we're already working on this issue. We'll let you know when it's done!

    in reply to: exclude some posts from post query #12245
    Anh TranAnh Tran
    Keymaster

    Hello,

    Let me check it again. Thanks for your feedback.

Viewing 15 posts - 1,591 through 1,605 (of 3,702 total)