Callbacks in block doesn't refresh

Support MB Blocks Callbacks in block doesn't refreshResolved

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #28005
    AXEL PARATREAXEL PARATRE
    Participant

    Hello team,

    We have an issue with the call back functions within a block in a select (MB Block).

    the call back gather for exemple all WooCommerce product, don't refresh the product list when a new one in created.

    Do you the way to automatically refresh the result of the callback function.

    Regards,
    Adrien

    #28017
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Can you please share some screenshots and the code that creates the block, callback function? I've re-checked on my local site and see the callback result updates as well.

    #28065
    AXEL PARATREAXEL PARATRE
    Participant

    Hi,
    The callback is included in the block builder (cf screenshot).
    If add a other product (in the good term) i dont see it in the selector

    1620632247-capture-12.png - envoi d'image avec NoelShack

    function nxt_get_accessories_list() {
        $posts = get_posts([
            "post_type"   => "product",
            "tax_query"   => [
                [
                    "taxonomy"    => "product_cat",
                    "field"       => "slug",
                    "terms"       => "accessoires"
                ]
            ]
        ]);
        $posts = array_map(
            function($post) {
                return [
                    $post->ID,
                    $post->post_title
                ];
            },
            $posts
        );
        return array_column(
            $posts,
            1,
            0
        );
    }
    #28075
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Click on the Edit and Preview button of the block, it reloads and fetches the new data as well. Screen record https://share.getcloudapp.com/X6ue60En. Can you please deactivate all plugins except Meta Box and MB extensions to re-check the issue?

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.