Commit Graph

3 Commits

Author SHA1 Message Date
Weston Ruter
2214f69e43 Customize: Allow controls to be registered without any associated settings.
* Improves parity between partials and controls. A partial or control can be settingless if instantiated with `settings` param as empty array (otherwise, if null, then the partial/control ID is used). 
* Eliminate need to create dummy settings that serve no purpose except to place a control in the UI.
* Removes dummy settings for `create_new_menu` and `new_menu_name`.
* Introduces `WP_Customize_Control::$capability` and `WP_Customize_Partial::$capability`, and if set checks them in the respective `check_capabilities()` methods.
* Prevents PHP fatal error from happening when non-existing settings are provided to control: "Call to a member function `check_capabilities()` on a non-object".
* Fixes issue where nav menu items and widgets were no longer working with selective refresh because cap check was failing.

See #27355.
Fixes #35926.

Built from https://develop.svn.wordpress.org/trunk@36689


git-svn-id: http://core.svn.wordpress.org/trunk@36656 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-24 18:28:28 +00:00
Weston Ruter
aa2db425d8 Customize: Skip exporting partials to client and handling rendering requests if user can't modify associated settings.
Introduces `WP_Customize_Partial::check_capabilities()` for parity with `WP_Customize_Control::check_capabilities()`.
 
See #27355.
Fixes #35914.

Built from https://develop.svn.wordpress.org/trunk@36643


git-svn-id: http://core.svn.wordpress.org/trunk@36610 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-23 18:14:26 +00:00
Weston Ruter
6b775d4afe Customize: Add selective refresh framework with implementation for widgets and re-implementation for nav menus.
See https://make.wordpress.org/core/2016/02/16/selective-refresh-in-the-customizer/.

Props westonruter, valendesigns, DrewAPicture, ocean90.
Fixes #27355.

Built from https://develop.svn.wordpress.org/trunk@36586


git-svn-id: http://core.svn.wordpress.org/trunk@36553 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-19 18:41:28 +00:00