[wp-trac] [WordPress Trac] #47820: should update_option() check "manage_options" capability?

WordPress Trac noreply at wordpress.org
Thu Aug 8 13:50:18 UTC 2019


#47820: should update_option() check "manage_options" capability?
----------------------------------------+---------------------
 Reporter:  lllor                       |       Owner:  (none)
     Type:  feature request             |      Status:  new
 Priority:  normal                      |   Milestone:  5.3
Component:  Options, Meta APIs          |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  needs-patch good-first-bug  |     Focuses:  docs
----------------------------------------+---------------------
Changes (by SergeyBiryukov):

 * keywords:  needs-patch => needs-patch good-first-bug
 * focuses:   => docs
 * milestone:  Future Release => 5.3


Comment:

 Replying to [comment:3 lllor]:
 > Excellent! So, if I haven't misunderstood, update_option must be used
 only in peculiar contexts and not as general-purpose interface to the wp-
 options provided to the plugins.

 It should be used for updating an option value in the database (instead of
 direct SQL queries, for example).

 As you wrote in the ticket description, it's plugin author's
 responsibility to check the appropriate capabilities before saving any
 option changes.

 Marking as a `good-first-bug` to reflect that in the function
 documentation.

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


More information about the wp-trac mailing list