Opened 4 years ago
Closed 4 years ago
#36960 closed enhancement (wontfix)
Add filter to maintenance_mode() function for $maintenance_string
Reported by: | amandato | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.5.2 |
Component: | Upgrade/Install | Keywords: | reporter-feedback |
Focuses: | Cc: | ||
PR Number: |
Description
Please add a filter for the maintenance_mode() function found in includes/class-wp-upgrader.php.
New line:
<?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 if( !(defined('WP_CLI') && WP_CLI) ) { $upgrading = time(); }
Attachments (1)
Change History (3)
#1
@
4 years ago
- Keywords reporter-feedback close added
Why would someone want to change that string?
Snippet from wp_maintenance()
:
global $upgrading; include( ABSPATH . '.maintenance' ); // If the $upgrading timestamp is older than 10 minutes, don't die. if ( ( time() - $upgrading ) >= 600 ) return;
class-wp-upgrader.diff is a bit broken. The patch should include the full path and the filename. Also, filters need to be documented as per the documentation standards.
Note: See
TracTickets for help on using
tickets.
Diff file of change made to WP 4.5.2