Changeset 44973 for trunk/src/wp-includes/error-protection.php
- Timestamp:
- 03/21/2019 09:52:07 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/error-protection.php
r44962 r44973 6 6 * @since 5.2.0 7 7 */ 8 9 /** 10 * Get the instance for storing paused plugins. 11 * 12 * @return WP_Paused_Extensions_Storage 13 */ 14 function wp_paused_plugins() { 15 static $storage = null; 16 17 if ( null === $storage ) { 18 $storage = new WP_Paused_Extensions_Storage( 'plugin' ); 19 } 20 21 return $storage; 22 } 23 24 /** 25 * Get the instance for storing paused extensions. 26 * 27 * @return WP_Paused_Extensions_Storage 28 */ 29 function wp_paused_themes() { 30 static $storage = null; 31 32 if ( null === $storage ) { 33 $storage = new WP_Paused_Extensions_Storage( 'theme' ); 34 } 35 36 return $storage; 37 } 38 39 /** 40 * Get a human readable description of an extension's error. 41 * 42 * @since 5.2.0 43 * 44 * @param array $error Error details {@see error_get_last()} 45 * 46 * @return string Formatted error description. 47 */ 48 function wp_get_extension_error_description( $error ) { 49 $constants = get_defined_constants( true ); 50 $constants = isset( $constants['Core'] ) ? $constants['Core'] : $constants['internal']; 51 $core_errors = array(); 52 53 foreach ( $constants as $constant => $value ) { 54 if ( 0 === strpos( $constant, 'E_' ) ) { 55 $core_errors[ $value ] = $constant; 56 } 57 } 58 59 if ( isset( $core_errors[ $error['type'] ] ) ) { 60 $error['type'] = $core_errors[ $error['type'] ]; 61 } 62 63 /* translators: 1: error type, 2: error line number, 3: error file name, 4: error message */ 64 $error_message = __( 'An error of type %1$s was caused in line %2$s of the file %3$s. Error message: %4$s' ); 65 66 return sprintf( 67 $error_message, 68 "<code>{$error['type']}</code>", 69 "<code>{$error['line']}</code>", 70 "<code>{$error['file']}</code>", 71 "<code>{$error['message']}</code>" 72 ); 73 } 8 74 9 75 /** … … 53 119 return apply_filters( 'wp_fatal_error_handler_enabled', $enabled ); 54 120 } 121 122 /** 123 * Access the WordPress Recovery Mode instance. 124 * 125 * @since 5.2.0 126 * 127 * @return WP_Recovery_Mode 128 */ 129 function wp_recovery_mode() { 130 static $wp_recovery_mode; 131 132 if ( ! $wp_recovery_mode ) { 133 $wp_recovery_mode = new WP_Recovery_Mode(); 134 } 135 136 return $wp_recovery_mode; 137 }
Note: See TracChangeset
for help on using the changeset viewer.