Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].
We have some project and use Vue.js. Now, our task is build template from json data that we will get via ajax.
Can i get $instance[‘some_filed’] via ajax by post_id?
Afte some time of styding source code, i found a solution. Here is my function
function get_widget_instance( $content, $widget_class ) { $instance = null; $post_blocks = parse_blocks($content); if( ! empty( $post_blocks ) ) { foreach( $post_blocks as $block ) { $widgets = $block['attrs']['panelsData']['widgets']; if( ! empty( $widgets ) ) { foreach( $widgets as $widget ) { if( $widget_class === $widget['panels_info']['class'] ) { $instance = $widget; break; } } } } } return $instance; }Hi Vitaly,
Great to hear you were able to come up with a solution that works for your setup.