"rwmb_outside_conditions" filter and WordPress 5.0
Issue Overview
"rwmb_outside_conditions" filter isn't working properly when block editor is active.
Steps to Reproduce (for bugs)
- Reload back end. Filter is working as expected. I'm using 'page_template' as condition.
- Switch between "Document" and "Block" settings type http://take.ms/2JVnd The filter is no longer working.
Setup:
Meta Box v. 4.15.8 Meta Box Conditional Logic v. 1.6.4
Code:
$conditions['.rwmb-tab-portfolio'] = array(
'visible' => array( 'page_template', 'templates/portfolio-template.php' )
);
Screenshots / Video
Video http://take.ms/tb9kc
Thoughts
It looks like the problem appears because WordPress now doesn't show or hide settings box, but removes it completely from the DOM. So, a possible solution is to bind 'change' event to "body" element and specify certain selector: $('body').on('change', '.class', function(){...}); Haven't looked into the code, just thoughts.
I have fixed this bug in the latest version 1.6.4. Please update.
Hi Rilwis, I'm having this issue with latest 1.6.4 as described above. I've also updated Meta Box to 4.15.9 today, but the problem is still there.
Thanks @fireform . I'll check that tomorrow and will update the plugin if needed.
Thanks, @rilwis. Any news about the issue?