[wp-trac] [WordPress Trac] #36960: Add filter to maintenance_mode() function for $maintenance_string

WordPress Trac noreply at wordpress.org
Fri May 27 13:57:07 UTC 2016


#36960: Add filter to maintenance_mode() function for $maintenance_string
-----------------------------+-----------------------------
 Reporter:  amandato         |      Owner:
     Type:  enhancement      |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Upgrade/Install  |    Version:  4.5.2
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 Please add a filter for the maintenance_mode() function found in includes
 /class-wp-upgrader.php.

 New line:
 {{{#!php
 <?php
 ...
 $maintenance_string = apply_filters( 'maintenance_string',
 $maintenance_string );
 ...
 }}}

 Adding this would allow a custom plugin to modify the $maintenance_string.
 Here is an example where a custom plugin would modify the maintenance
 string value to allow wp-cli to work while maintaining maintenance mode in
 all other cases:

 {{{#!php
 <?php
 if( !(defined('WP_CLI') && WP_CLI) ) { $upgrading = time(); }
 }}}

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


More information about the wp-trac mailing list