[wp-trac] [WordPress Trac] #51742: Core auto-updates UI: disable checkbox when filter or constant takes precedent on the option

WordPress Trac noreply at wordpress.org
Wed Nov 11 08:56:52 UTC 2020


#51742: Core auto-updates UI: disable checkbox when filter or constant takes
precedent on the option
-------------------------------------------------+-------------------------
 Reporter:  audrasjb                             |       Owner:  audrasjb
     Type:  defect (bug)                         |      Status:  accepted
 Priority:  normal                               |   Milestone:  5.6
Component:  Upgrade/Install                      |     Version:  trunk
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-screenshots needs-     |     Focuses:  ui
  copy-review needs-design-feedback dev-         |
  feedback                                       |
-------------------------------------------------+-------------------------

Comment (by audrasjb):

 @azaozz ah, about running the filter two times in a row, that's because it
 serves two different goals:

 {{{
 $upgrade_major = apply_filters( 'allow_major_auto_core_updates',
 $upgrade_major );
 }}}
 The idea is to get the value or the filter or to apply `$upgrade_major`
 value. This is for the final value of the option.

 {{{
 $is_major_optin_disabled = apply_filters( 'allow_major_auto_core_updates',
 null );
 }}}

 The idea is to test if the filter should disable the UI. If it returns
 `null`, we know that the filter is not applied.

 But that's coming from the previous way this section was managed. We can
 probably adapt that and get rid of this double call.

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


More information about the wp-trac mailing list