wp/wp-includes/error-protection.php
changeset 18 be944660c56a
parent 16 a86126ab1dd4
child 19 3d72ae0968f4
equal deleted inserted replaced
17:34716fd837a4 18:be944660c56a
   109 	$enabled = ! defined( 'WP_DISABLE_FATAL_ERROR_HANDLER' ) || ! WP_DISABLE_FATAL_ERROR_HANDLER;
   109 	$enabled = ! defined( 'WP_DISABLE_FATAL_ERROR_HANDLER' ) || ! WP_DISABLE_FATAL_ERROR_HANDLER;
   110 
   110 
   111 	/**
   111 	/**
   112 	 * Filters whether the fatal error handler is enabled.
   112 	 * Filters whether the fatal error handler is enabled.
   113 	 *
   113 	 *
       
   114 	 * **Important:** This filter runs before it can be used by plugins. It cannot
       
   115 	 * be used by plugins, mu-plugins, or themes. To use this filter you must define
       
   116 	 * a `$wp_filter` global before WordPress loads, usually in `wp-config.php`.
       
   117 	 *
       
   118 	 * Example:
       
   119 	 *
       
   120 	 *     $GLOBALS['wp_filter'] = array(
       
   121 	 *         'wp_fatal_error_handler_enabled' => array(
       
   122 	 *             10 => array(
       
   123 	 *                 array(
       
   124 	 *                     'accepted_args' => 0,
       
   125 	 *                     'function'      => function() {
       
   126 	 *                         return false;
       
   127 	 *                     },
       
   128 	 *                 ),
       
   129 	 *             ),
       
   130 	 *         ),
       
   131 	 *     );
       
   132 	 *
       
   133 	 * Alternatively you can use the `WP_DISABLE_FATAL_ERROR_HANDLER` constant.
       
   134 	 *
   114 	 * @since 5.2.0
   135 	 * @since 5.2.0
   115 	 *
   136 	 *
   116 	 * @param bool $enabled True if the fatal error handler is enabled, false otherwise.
   137 	 * @param bool $enabled True if the fatal error handler is enabled, false otherwise.
   117 	 */
   138 	 */
   118 	return apply_filters( 'wp_fatal_error_handler_enabled', $enabled );
   139 	return apply_filters( 'wp_fatal_error_handler_enabled', $enabled );