Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"rwmb_outside_conditions" filter and WordPress 5.0 #1295

Open
fireform opened this issue Dec 12, 2018 · 4 comments
Open

"rwmb_outside_conditions" filter and WordPress 5.0 #1295

fireform opened this issue Dec 12, 2018 · 4 comments

Comments

@fireform
Copy link

fireform commented Dec 12, 2018

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.

@rilwis
Copy link
Member

rilwis commented Dec 13, 2018

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

@rilwis rilwis closed this as completed Dec 13, 2018
@fireform
Copy link
Author

fireform commented Dec 13, 2018

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.

@rilwis rilwis reopened this Dec 13, 2018
@rilwis
Copy link
Member

rilwis commented Dec 13, 2018

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

@fireform
Copy link
Author

Thanks, @rilwis. Any news about the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants