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

Improve compatibility with plugins (e.g. Jetpack Widget Visibility module) #39

Closed
westonruter opened this Issue Oct 21, 2013 · 4 comments

Comments

Projects
None yet
1 participant
@westonruter
Contributor

westonruter commented Oct 21, 2013

Reported by @shaunandrews:

I'm getting an error. Looks like something happening with Jetpack: Warning: Invalid argument supplied for foreach() in /Users/shaunandrews/Sites/WordPress/wp-content/plugins/jetpack/modules/widget-visibility/widget-conditions.php on line 249

Either the Jetpack plugin is not extending widgets properly, or the Widget Customizer is not adequately setting up the environment for rendering widget controls in the customizer.

@westonruter

This comment has been minimized.

Show comment
Hide comment
@westonruter

westonruter Oct 27, 2013

Contributor

Also the styling of the widget restriction controls is lacking, if that module is enabled.

Contributor

westonruter commented Oct 27, 2013

Also the styling of the widget restriction controls is lacking, if that module is enabled.

westonruter added a commit that referenced this issue Oct 28, 2013

westonruter added a commit that referenced this issue Oct 28, 2013

Do actions, add ajaxurl, and add div#widgets-right for compat
Widget form controls expect to be set up on the widgets page, so the
actions triggered on that page need to be manually triggered here
(just like the Ajax handler does)

The widgets page also exposes an ajaxurl global JavaScript variable
which the Customizer does not export, so we have to set it as well.

Lastly, many widgets expect for their controls to be rendered inside
of a div#widgets-right which does not exist in the customizer, so we
have to make one of the divs in the customizer have that ID for
compatability.

See #39
@westonruter

This comment has been minimized.

Show comment
Hide comment
@westonruter

westonruter Oct 28, 2013

Contributor

@shaunandrews speaking of .widget-liquid-right, I had to hack (77ae355) the Customizer DOM to add the widgets-right ID to a container div for compatibility with plugins that anchor selectors on div#widgets-right 😦

Contributor

westonruter commented Oct 28, 2013

@shaunandrews speaking of .widget-liquid-right, I had to hack (77ae355) the Customizer DOM to add the widgets-right ID to a container div for compatibility with plugins that anchor selectors on div#widgets-right 😦

@westonruter

This comment has been minimized.

Show comment
Hide comment
@westonruter

westonruter Oct 28, 2013

Contributor

Jetpack's Widget Visibility module now works properly. It looks like this when rendered in the customizer:

customize_twenty_thirteen__wordpress

Contributor

westonruter commented Oct 28, 2013

Jetpack's Widget Visibility module now works properly. It looks like this when rendered in the customizer:

customize_twenty_thirteen__wordpress

@westonruter

This comment has been minimized.

Show comment
Hide comment
@westonruter

westonruter Oct 28, 2013

Contributor

There's also a bug with the Jetpack Widget Visibility module in that it assumes widgets are always multi-widgets, and that they are not old single widgets. Submitted patch to the Jetpack ticket which was opened 3 weeks ago: http://plugins.trac.wordpress.org/ticket/1979

Contributor

westonruter commented Oct 28, 2013

There's also a bug with the Jetpack Widget Visibility module in that it assumes widgets are always multi-widgets, and that they are not old single widgets. Submitted patch to the Jetpack ticket which was opened 3 weeks ago: http://plugins.trac.wordpress.org/ticket/1979

westonruter added a commit that referenced this issue Oct 28, 2013

Render widget control templates into DOM for plugins to manipulate
The Jetpack Widget Visibility module expects the widget templates to
be rendered into the DOM as hidden elements so that it can inject the
"Visibility" button in the proper place. So we have to move the
templates from the model and into the DOM for compat.

Addendum to #39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment