[wp-trac] [WordPress Trac] #28637: get_theme_mod returns empty string instead of default

WordPress Trac noreply at wordpress.org
Wed Aug 19 18:05:31 UTC 2015


#28637: get_theme_mod returns empty string instead of default
----------------------------------------+-----------------------------
 Reporter:  philipjohn                  |       Owner:  valendesigns
     Type:  defect (bug)                |      Status:  assigned
 Priority:  normal                      |   Milestone:  4.4
Component:  Customize                   |     Version:  3.9.1
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:  administration
----------------------------------------+-----------------------------

Comment (by MikeHansenMe):

 In the steps to reproduce the remove and image they had set. What is
 happening is now an empty string is being returned so whatever is
 depending on it is getting an empty string and likely not handling it. I
 think the correct behavior here is for it to be unset, then when it checks
 for the theme mod the default will be used.

 so if someone is using get_theme_mod('thing', 'http://url-to-default-
 image.com/image.png' );

 It will return an empty string instead of the default.

 I can write a sample plugin or something to confirm this is correct but
 that is my understanding of it.

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


More information about the wp-trac mailing list