Hi Anh - it's been a while since opened this topic so I hope it's not too late to add to the thread...
the goal of the code snippet is to generate a screenshot from a URL entered into a form field.
Scenario - user enters data into a form that populates a custom template. the custom template displays the data collected in the form. one of the form fields is a URL field. in the custom template, instead of displaying only the URL field value (ex - https://google.com) as a text value, an actual screenshot of the URL is captured and displayed in the template.
here is the equivalent feature available for ACF Pro plugin - https://codecanyon.net/item/acf-website-screenshot/6280665
so, I'm hoping that this same feature can be worked into MB. thanks!