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

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

Closed
westonruter opened this issue Oct 21, 2013 · 4 comments
Milestone

Comments

@westonruter
Copy link
Contributor

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
Copy link
Contributor Author

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
Eliminates a warning from Jetpack. See #39.
westonruter added a commit that referenced this issue Oct 28, 2013
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
Copy link
Contributor Author

@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
Copy link
Contributor Author

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

customize_twenty_thirteen__wordpress

@westonruter
Copy link
Contributor Author

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
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant