Changeset 56530 for trunk/src/wp-includes/functions.php
- Timestamp:
- 09/06/2023 10:06:26 PM (13 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r56522 r56530 6041 6041 6042 6042 /** 6043 * Generates a user-level error/warning/notice/deprecation message. 6044 * 6045 * Generates the message when `WP_DEBUG` is true. 6046 * 6047 * @since 6.4.0 6048 * 6049 * @param string $function_name The function that triggered the error. 6050 * @param string $message The message explaining the error. 6051 * @param int $error_level Optional. The designated error type for this error. 6052 * Only works with E_USER family of constants. Default E_USER_NOTICE. 6053 */ 6054 function wp_trigger_error( $function_name, $message, $error_level = E_USER_NOTICE ) { 6055 6056 // Bail out if WP_DEBUG is not turned on. 6057 if ( ! WP_DEBUG ) { 6058 return; 6059 } 6060 6061 /** 6062 * Fires when the given function triggers a user-level error/warning/notice/deprecation message. 6063 * 6064 * Can be used for debug backtracking. 6065 * 6066 * @since 6.4.0 6067 * 6068 * @param string $function_name The function that was called. 6069 * @param string $message A message explaining what has been done incorrectly. 6070 * @param int $error_level The designated error type for this error. 6071 */ 6072 do_action( 'wp_trigger_error_run', $function_name, $message, $error_level ); 6073 6074 if ( ! empty( $function_name ) ) { 6075 $message = sprintf( '%s(): %s', $function_name, $message ); 6076 } 6077 6078 /* 6079 * If the message appears in the browser, then it needs to be escaped. 6080 * Note the warning in the `trigger_error()` PHP manual. 6081 * @link https://www.php.net/manual/en/function.trigger-error.php 6082 */ 6083 $message = esc_html( $message ); 6084 6085 trigger_error( $message, $error_level ); 6086 } 6087 6088 /** 6043 6089 * Determines whether the server is running an earlier than 1.5.0 version of lighttpd. 6044 6090 *
Note: See TracChangeset
for help on using the changeset viewer.