I have a code block that enqueues scripts.
add_action('wp_enqueue_scripts', function() {
...
wp_enqueue_script('stripe', 'https://js.stripe.com/v3/');
wp_enqueue_script('checkout', $js, array(), $ver, array('strategy' => 'defer'));
...
});
The code block is placed inside a Div block with visibility conditions.
My expectation is that the code inside the code block will execute only when the visibility condition of its parent/ancestor is met. However, this is not the case. The code block is always executed. Resulting the scripts to be enqueued although they shouldn’t.
The code block should be executed (evaluated) only when visibility conditions of the parent/ancestor is met.
- WordPress version: 6.4.1
- Cwicly Plugin version: 1.3.4.1