[wp-trac] [WordPress Trac] #47678: Modernize/simplify current_user_can()

WordPress Trac noreply at wordpress.org
Tue Sep 17 17:03:57 UTC 2019


#47678: Modernize/simplify current_user_can()
-------------------------------------+-------------------------------------
 Reporter:  jrf                      |       Owner:  pento
     Type:  enhancement              |      Status:  assigned
 Priority:  normal                   |   Milestone:  5.3
Component:  Role/Capability          |     Version:  trunk
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch has-unit-      |     Focuses:  performance, coding-
  tests commit needs-dev-note        |  standards
-------------------------------------+-------------------------------------

Comment (by SergeyBiryukov):

 Replying to [comment:60 SergeyBiryukov]:
 > Replying to [comment:59 jrf]:
 > > I agree, though to be honest, this would indicate that the PHP version
 check is done too late in the process flow, rather than that this patch is
 invalid.
 > >
 > > All the same, let's leave that for later.
 >
 > Right. We could potentially run `wp_check_php_mysql_versions()` earlier,
 but `wp-includes/plugin.php` is also included in
 `wp_load_translations_early()` before displaying the error message,
 apparently for `do_action()` and `apply_filters()`.
 >
 > I would be up for exploring ways to remove that dependency in a new
 ticket. Since plugins cannot be loaded at that point, we could stub those
 functions in a way similar to `wp-admin/includes/noop.php`, or just
 display the message in English.

 Created #48059 to change the process flow and check the required PHP
 version as early as possible, so that the original version of
 [attachment:"47678-do_action.patch"] could be committed. Could you refresh
 that patch after [46149]?

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


More information about the wp-trac mailing list