[wp-trac] [WordPress Trac] #33684: Cheatin' uh?: Update in wp-includes/class-wp-customize-manager.php

WordPress Trac noreply at wordpress.org
Wed Sep 2 22:23:54 UTC 2015


#33684: Cheatin' uh?: Update in wp-includes/class-wp-customize-manager.php
-----------------------------+------------------------------
 Reporter:  kraftbj          |       Owner:
     Type:  enhancement      |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Role/Capability  |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |     Focuses:  ui
-----------------------------+------------------------------
Changes (by kraftbj):

 * keywords:   => has-patch


Comment:

 This file has a custom wp_die handler, so I applied the logic and spirit
 of #14530 like this:

 * "Upstream" from the actual `wp_die` call, I added error messages to each
 instance of the class' `wp_die` function.
 * For the generic theme error return, I used
 `$this->theme()->errors()->get_error_message()`. To follow the chain, the
 class' `theme()` calls `wp_get_theme`, which is a `WP_Theme` object.
 `WP_Theme::errors()` returns the `WP_Error` object, so `get_error_message`
 returns the pretty error message.

 An example to test that error message:
 0. WordPress install with multiple themes installed. Access the
 Customizer. Preview theme A.
 1. From another window, delete theme B.
 2. From the original window, attempt to Live Preview theme A.

 The result will be the attached screenshot.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33684#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list