[wp-trac] [WordPress Trac] #43360: Third parameter for get_option function to return default value instead of empty string

WordPress Trac noreply at wordpress.org
Tue Feb 20 00:06:44 UTC 2018


#43360: Third parameter for get_option function to return default value instead of
empty string
-----------------------------------------+------------------------------
 Reporter:  farhan.noor                  |       Owner:
     Type:  enhancement                  |      Status:  new
 Priority:  normal                       |   Milestone:  Awaiting Review
Component:  Options, Meta APIs           |     Version:  4.9.4
 Severity:  normal                       |  Resolution:
 Keywords:  close 2nd-opinion has-patch  |     Focuses:
-----------------------------------------+------------------------------
Changes (by farhan.noor):

 * keywords:  close 2nd-opinion => close 2nd-opinion has-patch


Comment:

 Hi SergeyBiryukov

 Thank you for your quick response. I have created a patch as per
 instructions & is attached herewith.

 My proposed solution will not affect default behavior of the function but
 it will add another enhancement to the function when using with 3rd
 parameter. In many situations NULL values are considered as unanswered
 hence default value in-place of NULL/empty is required. This patch will
 work fine in that situation, without 3rd parameter it will keep working as
 before.

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


More information about the wp-trac mailing list