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

WordPress Trac noreply at wordpress.org
Wed Jun 25 19:59:33 UTC 2014

#28637: get_theme_mod returns empty string instead of default
 Reporter:  philipjohn      |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Customize       |    Version:  3.9.1
 Severity:  normal          |   Keywords:
  Focuses:  administration  |
 In some instances, get_theme_mod() is returning an empty string when a
 value for default is provided. Given an empty string is of little use it
 should probably (!) be treated as false and the default returned instead.

 Steps to reproduce:
 * With a customiser image control available in your theme, set an image
 and save
 * Now remove that image
 * Using get_theme_mods to retrieve that setting, when passed a default,
 will return an empty string rather than the default

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

More information about the wp-trac mailing list