ndiego / block-visibility

Conditional visibility controls for all WordPress blocks.
https://www.blockvisibilitywp.com
GNU General Public License v2.0
130 stars 10 forks source link

Admin scripts loading on frontend for pages that run Ajax #20

Closed ndiego closed 3 years ago

ndiego commented 3 years ago

Bug reported via support email:


Block Visibility Pro loads various admin scripts on the front-end for pages that run Ajax which caused issues on our site. I've recorded a 3 minute video: https://www.loom.com/share/f6e45f00c414401b9ff4111c353c1e81

I fixed it with the following: file: /block-visibility-pro/includes/class-block-visibility-pro.pho line 118 change this: if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {

to this: if ( is_admin() && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {

ndiego commented 3 years ago

This has been fixed.