How to get render_callback() have a dynamic output?

Support MB Blocks How to get render_callback() have a dynamic output?Resolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #43124
    hello@adame.io[email protected]
    Participant

    When using MB Blocks, with a render_callback() what I noticed is that the output will be static and reflect what was there when the post was saved.

    Is there any way to make the render_callback() render on the frontend? and not stick to the state when it was last saved on the post?

    Here is how to see the issue:

    Create an MB Block that will output time().

    Add it to a post and save it.

    Check the post on the frontend. And refresh a couple of times. You will see the same timestamp showing there.

    Is there any turnaround to make it so the output is dynamic? In the above case, show the current timestamp on each refresh.

    #43132
    PeterPeter
    Moderator

    Hello,

    I use the time() function in the code block but do not save the time to the post content (a field value), the current timestamp displays correctly. Here is the screen record
    https://drive.google.com/file/d/1atXi3wDdh67Jszpg6KQEj2Ir1zT5lb4A/view?usp=sharing

    Can you please share some screenshots of block settings on your site?

    #43136
    hello@adame.io[email protected]
    Participant

    The out is working as expected.

    Thanks for checking. Your confirmation helped me recall where the root cause of the issue I was experiencing was 🙏

    It was a mistake on my end. I was pre-processing the output and caching it 😅 and I totally forgot about that 😜

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