meta-box icon indicating copy to clipboard operation
meta-box copied to clipboard

"rwmb_outside_conditions" filter and WordPress 5.0

Open fireform opened this issue 7 years ago • 4 comments

Issue Overview

"rwmb_outside_conditions" filter isn't working properly when block editor is active.

Steps to Reproduce (for bugs)

  1. Reload back end. Filter is working as expected. I'm using 'page_template' as condition.
  2. 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.

fireform avatar Dec 12 '18 13:12 fireform

I have fixed this bug in the latest version 1.6.4. Please update.

rilwis avatar Dec 13 '18 09:12 rilwis

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.

fireform avatar Dec 13 '18 11:12 fireform

Thanks @fireform . I'll check that tomorrow and will update the plugin if needed.

rilwis avatar Dec 13 '18 17:12 rilwis

Thanks, @rilwis. Any news about the issue?

fireform avatar Dec 21 '18 09:12 fireform