+ * Attempt to determine the real file type of a file.
+ *
+ * If unable to, the file name extension will be used to determine type.
+ *
+ * If it's determined that the extension does not match the file's real type,
+ * then the "proper_filename" value will be set with a proper filename and extension.
+ *
+ * Currently this function only supports renaming images validated via wp_get_image_mime().
+ *
+ * @since 3.0.0
+ *
+ * @param string $file Full path to the file.
+ * @param string $filename The name of the file (may differ from $file due to $file being
+ * in a tmp directory).
+ * @param array $mimes Optional. Key is the file extension with value as the mime type.
+ * @return array Values for the extension, MIME, and either a corrected filename or false
+ * if original $filename is valid.
+ */
+function wp_check_filetype_and_ext( $file, $filename, $mimes = null ) {
+ $proper_filename = false;
+
+ // Do basic extension validation and MIME mapping
+ $wp_filetype = wp_check_filetype( $filename, $mimes );
+ $ext = $wp_filetype['ext'];
+ $type = $wp_filetype['type'];
+
+ // We can't do any further validation without a file to work with
+ if ( ! file_exists( $file ) ) {
+ return compact( 'ext', 'type', 'proper_filename' );
+ }
+
+ // Validate image types.
+ if ( $type && 0 === strpos( $type, 'image/' ) ) {
+
+ // Attempt to figure out what type of image it actually is
+ $real_mime = wp_get_image_mime( $file );
+
+ if ( ! $real_mime ) {
+ $type = $ext = false;
+ } elseif ( $real_mime != $type ) {
+ /**
+ * Filters the list mapping image mime types to their respective extensions.
+ *
+ * @since 3.0.0
+ *
+ * @param array $mime_to_ext Array of image mime types and their matching extensions.
+ */
+ $mime_to_ext = apply_filters( 'getimagesize_mimes_to_exts', array(
+ 'image/jpeg' => 'jpg',
+ 'image/png' => 'png',
+ 'image/gif' => 'gif',
+ 'image/bmp' => 'bmp',
+ 'image/tiff' => 'tif',
+ ) );
+
+ // Replace whatever is after the last period in the filename with the correct extension
+ if ( ! empty( $mime_to_ext[ $real_mime ] ) ) {
+ $filename_parts = explode( '.', $filename );
+ array_pop( $filename_parts );
+ $filename_parts[] = $mime_to_ext[ $real_mime ];
+ $new_filename = implode( '.', $filename_parts );
+
+ if ( $new_filename != $filename ) {
+ $proper_filename = $new_filename; // Mark that it changed
+ }
+ // Redefine the extension / MIME
+ $wp_filetype = wp_check_filetype( $new_filename, $mimes );
+ $ext = $wp_filetype['ext'];
+ $type = $wp_filetype['type'];
+ } else {
+ $type = $ext = false;
+ }
+ }
+ } elseif ( function_exists( 'finfo_file' ) ) {
+ // Use finfo_file if available to validate non-image files.
+ $finfo = finfo_open( FILEINFO_MIME_TYPE );
+ $real_mime = finfo_file( $finfo, $file );
+ finfo_close( $finfo );
+
+ // If the extension does not match the file's real type, return false.
+ if ( $real_mime !== $type ) {
+ $type = $ext = false;
+ }
+ }
+
+ /**
+ * Filters the "real" file type of the given file.
+ *
+ * @since 3.0.0
+ *
+ * @param array $wp_check_filetype_and_ext File data array containing 'ext', 'type', and
+ * 'proper_filename' keys.
+ * @param string $file Full path to the file.
+ * @param string $filename The name of the file (may differ from $file due to
+ * $file being in a tmp directory).
+ * @param array $mimes Key is the file extension with value as the mime type.
+ */
+ return apply_filters( 'wp_check_filetype_and_ext', compact( 'ext', 'type', 'proper_filename' ), $file, $filename, $mimes );
+}
+
+/**
+ * Returns the real mime type of an image file.
+ *
+ * This depends on exif_imagetype() or getimagesize() to determine real mime types.
+ *
+ * @since 4.7.1
+ *
+ * @param string $file Full path to the file.
+ * @return string|false The actual mime type or false if the type cannot be determined.
+ */
+function wp_get_image_mime( $file ) {
+ /*
+ * Use exif_imagetype() to check the mimetype if available or fall back to
+ * getimagesize() if exif isn't avaialbe. If either function throws an Exception
+ * we assume the file could not be validated.
+ */
+ try {
+ if ( is_callable( 'exif_imagetype' ) ) {
+ $mime = image_type_to_mime_type( exif_imagetype( $file ) );
+ } elseif ( function_exists( 'getimagesize' ) ) {
+ $imagesize = getimagesize( $file );
+ $mime = ( isset( $imagesize['mime'] ) ) ? $imagesize['mime'] : false;
+ } else {
+ $mime = false;
+ }
+ } catch ( Exception $e ) {
+ $mime = false;
+ }
+
+ return $mime;
+}
+
+/**
+ * Retrieve list of mime types and file extensions.
+ *
+ * @since 3.5.0
+ * @since 4.2.0 Support was added for GIMP (xcf) files.
+ *
+ * @return array Array of mime types keyed by the file extension regex corresponding to those types.
+ */
+function wp_get_mime_types() {
+ /**
+ * Filters the list of mime types and file extensions.
+ *
+ * This filter should be used to add, not remove, mime types. To remove
+ * mime types, use the {@see 'upload_mimes'} filter.
+ *
+ * @since 3.5.0
+ *
+ * @param array $wp_get_mime_types Mime types keyed by the file extension regex
+ * corresponding to those types.
+ */
+ return apply_filters( 'mime_types', array(
+ // Image formats.
+ 'jpg|jpeg|jpe' => 'image/jpeg',
+ 'gif' => 'image/gif',
+ 'png' => 'image/png',
+ 'bmp' => 'image/bmp',
+ 'tiff|tif' => 'image/tiff',
+ 'ico' => 'image/x-icon',
+ // Video formats.
+ 'asf|asx' => 'video/x-ms-asf',
+ 'wmv' => 'video/x-ms-wmv',
+ 'wmx' => 'video/x-ms-wmx',
+ 'wm' => 'video/x-ms-wm',
+ 'avi' => 'video/avi',
+ 'divx' => 'video/divx',
+ 'flv' => 'video/x-flv',
+ 'mov|qt' => 'video/quicktime',
+ 'mpeg|mpg|mpe' => 'video/mpeg',
+ 'mp4|m4v' => 'video/mp4',
+ 'ogv' => 'video/ogg',
+ 'webm' => 'video/webm',
+ 'mkv' => 'video/x-matroska',
+ '3gp|3gpp' => 'video/3gpp', // Can also be audio
+ '3g2|3gp2' => 'video/3gpp2', // Can also be audio
+ // Text formats.
+ 'txt|asc|c|cc|h|srt' => 'text/plain',
+ 'csv' => 'text/csv',
+ 'tsv' => 'text/tab-separated-values',
+ 'ics' => 'text/calendar',
+ 'rtx' => 'text/richtext',
+ 'css' => 'text/css',
+ 'htm|html' => 'text/html',
+ 'vtt' => 'text/vtt',
+ 'dfxp' => 'application/ttaf+xml',
+ // Audio formats.
+ 'mp3|m4a|m4b' => 'audio/mpeg',
+ 'ra|ram' => 'audio/x-realaudio',
+ 'wav' => 'audio/wav',
+ 'ogg|oga' => 'audio/ogg',
+ 'mid|midi' => 'audio/midi',
+ 'wma' => 'audio/x-ms-wma',
+ 'wax' => 'audio/x-ms-wax',
+ 'mka' => 'audio/x-matroska',
+ // Misc application formats.
+ 'rtf' => 'application/rtf',
+ 'js' => 'application/javascript',
+ 'pdf' => 'application/pdf',
+ 'swf' => 'application/x-shockwave-flash',
+ 'class' => 'application/java',
+ 'tar' => 'application/x-tar',
+ 'zip' => 'application/zip',
+ 'gz|gzip' => 'application/x-gzip',
+ 'rar' => 'application/rar',
+ '7z' => 'application/x-7z-compressed',
+ 'exe' => 'application/x-msdownload',
+ 'psd' => 'application/octet-stream',
+ 'xcf' => 'application/octet-stream',
+ // MS Office formats.
+ 'doc' => 'application/msword',
+ 'pot|pps|ppt' => 'application/vnd.ms-powerpoint',
+ 'wri' => 'application/vnd.ms-write',
+ 'xla|xls|xlt|xlw' => 'application/vnd.ms-excel',
+ 'mdb' => 'application/vnd.ms-access',
+ 'mpp' => 'application/vnd.ms-project',
+ 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
+ 'docm' => 'application/vnd.ms-word.document.macroEnabled.12',
+ 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
+ 'dotm' => 'application/vnd.ms-word.template.macroEnabled.12',
+ 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+ 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12',
+ 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
+ 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
+ 'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12',
+ 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12',
+ 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
+ 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
+ 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
+ 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12',
+ 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',
+ 'potm' => 'application/vnd.ms-powerpoint.template.macroEnabled.12',
+ 'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12',
+ 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',
+ 'sldm' => 'application/vnd.ms-powerpoint.slide.macroEnabled.12',
+ 'onetoc|onetoc2|onetmp|onepkg' => 'application/onenote',
+ 'oxps' => 'application/oxps',
+ 'xps' => 'application/vnd.ms-xpsdocument',
+ // OpenOffice formats.
+ 'odt' => 'application/vnd.oasis.opendocument.text',
+ 'odp' => 'application/vnd.oasis.opendocument.presentation',
+ 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
+ 'odg' => 'application/vnd.oasis.opendocument.graphics',
+ 'odc' => 'application/vnd.oasis.opendocument.chart',
+ 'odb' => 'application/vnd.oasis.opendocument.database',
+ 'odf' => 'application/vnd.oasis.opendocument.formula',
+ // WordPerfect formats.
+ 'wp|wpd' => 'application/wordperfect',
+ // iWork formats.
+ 'key' => 'application/vnd.apple.keynote',
+ 'numbers' => 'application/vnd.apple.numbers',
+ 'pages' => 'application/vnd.apple.pages',
+ ) );
+}
+
+/**
+ * Retrieves the list of common file extensions and their types.
+ *
+ * @since 4.6.0
+ *
+ * @return array Array of file extensions types keyed by the type of file.
+ */
+function wp_get_ext_types() {
+
+ /**
+ * Filters file type based on the extension name.
+ *
+ * @since 2.5.0
+ *
+ * @see wp_ext2type()
+ *
+ * @param array $ext2type Multi-dimensional array with extensions for a default set
+ * of file types.
+ */
+ return apply_filters( 'ext2type', array(
+ 'image' => array( 'jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp', 'tif', 'tiff', 'ico' ),
+ 'audio' => array( 'aac', 'ac3', 'aif', 'aiff', 'm3a', 'm4a', 'm4b', 'mka', 'mp1', 'mp2', 'mp3', 'ogg', 'oga', 'ram', 'wav', 'wma' ),
+ 'video' => array( '3g2', '3gp', '3gpp', 'asf', 'avi', 'divx', 'dv', 'flv', 'm4v', 'mkv', 'mov', 'mp4', 'mpeg', 'mpg', 'mpv', 'ogm', 'ogv', 'qt', 'rm', 'vob', 'wmv' ),
+ 'document' => array( 'doc', 'docx', 'docm', 'dotm', 'odt', 'pages', 'pdf', 'xps', 'oxps', 'rtf', 'wp', 'wpd', 'psd', 'xcf' ),
+ 'spreadsheet' => array( 'numbers', 'ods', 'xls', 'xlsx', 'xlsm', 'xlsb' ),
+ 'interactive' => array( 'swf', 'key', 'ppt', 'pptx', 'pptm', 'pps', 'ppsx', 'ppsm', 'sldx', 'sldm', 'odp' ),
+ 'text' => array( 'asc', 'csv', 'tsv', 'txt' ),
+ 'archive' => array( 'bz2', 'cab', 'dmg', 'gz', 'rar', 'sea', 'sit', 'sqx', 'tar', 'tgz', 'zip', '7z' ),
+ 'code' => array( 'css', 'htm', 'html', 'php', 'js' ),
+ ) );
+}
+
+/**
+ * Retrieve list of allowed mime types and file extensions.
+ *
+ * @since 2.8.6
+ *
+ * @param int|WP_User $user Optional. User to check. Defaults to current user.
+ * @return array Array of mime types keyed by the file extension regex corresponding
+ * to those types.
+ */
+function get_allowed_mime_types( $user = null ) {
+ $t = wp_get_mime_types();
+
+ unset( $t['swf'], $t['exe'] );
+ if ( function_exists( 'current_user_can' ) )
+ $unfiltered = $user ? user_can( $user, 'unfiltered_html' ) : current_user_can( 'unfiltered_html' );
+
+ if ( empty( $unfiltered ) )
+ unset( $t['htm|html'] );
+
+ /**
+ * Filters list of allowed mime types and file extensions.
+ *
+ * @since 2.0.0
+ *
+ * @param array $t Mime types keyed by the file extension regex corresponding to
+ * those types. 'swf' and 'exe' removed from full list. 'htm|html' also
+ * removed depending on '$user' capabilities.
+ * @param int|WP_User|null $user User ID, User object or null if not provided (indicates current user).
+ */
+ return apply_filters( 'upload_mimes', $t, $user );
+}
+
+/**
+ * Display "Are You Sure" message to confirm the action being taken.
+ *
+ * If the action has the nonce explain message, then it will be displayed
+ * along with the "Are you sure?" message.
+ *
+ * @since 2.0.4
+ *
+ * @param string $action The nonce action.
+ */
+function wp_nonce_ays( $action ) {
+ if ( 'log-out' == $action ) {
+ $html = sprintf(
+ /* translators: %s: site name */
+ __( 'You are attempting to log out of %s' ),
+ get_bloginfo( 'name' )
+ );
+ $html .= '</p><p>';
+ $redirect_to = isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
+ $html .= sprintf(
+ /* translators: %s: logout URL */
+ __( 'Do you really want to <a href="%s">log out</a>?' ),
+ wp_logout_url( $redirect_to )
+ );
+ } else {
+ $html = __( 'Are you sure you want to do this?' );
+ if ( wp_get_referer() ) {
+ $html .= '</p><p>';
+ $html .= sprintf( '<a href="%s">%s</a>',
+ esc_url( remove_query_arg( 'updated', wp_get_referer() ) ),
+ __( 'Please try again.' )
+ );
+ }
+ }
+
+ wp_die( $html, __( 'WordPress Failure Notice' ), 403 );
+}
+
+/**
+ * Kill WordPress execution and display HTML message with error message.
+ *
+ * This function complements the `die()` PHP function. The difference is that
+ * HTML will be displayed to the user. It is recommended to use this function
+ * only when the execution should not continue any further. It is not recommended
+ * to call this function very often, and try to handle as many errors as possible
+ * silently or more gracefully.
+ *
+ * As a shorthand, the desired HTTP response code may be passed as an integer to
+ * the `$title` parameter (the default title would apply) or the `$args` parameter.
+ *
+ * @since 2.0.4
+ * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept
+ * an integer to be used as the response code.
+ *
+ * @param string|WP_Error $message Optional. Error message. If this is a WP_Error object,
+ * and not an Ajax or XML-RPC request, the error's messages are used.
+ * Default empty.
+ * @param string|int $title Optional. Error title. If `$message` is a `WP_Error` object,
+ * error data with the key 'title' may be used to specify the title.
+ * If `$title` is an integer, then it is treated as the response
+ * code. Default empty.
+ * @param string|array|int $args {
+ * Optional. Arguments to control behavior. If `$args` is an integer, then it is treated
+ * as the response code. Default empty array.
+ *
+ * @type int $response The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
+ * @type bool $back_link Whether to include a link to go back. Default false.
+ * @type string $text_direction The text direction. This is only useful internally, when WordPress
+ * is still loading and the site's locale is not set up yet. Accepts 'rtl'.
+ * Default is the value of is_rtl().
+ * }
+ */
+function wp_die( $message = '', $title = '', $args = array() ) {
+
+ if ( is_int( $args ) ) {
+ $args = array( 'response' => $args );
+ } elseif ( is_int( $title ) ) {
+ $args = array( 'response' => $title );
+ $title = '';
+ }
+
+ if ( wp_doing_ajax() ) {
+ /**
+ * Filters the callback for killing WordPress execution for Ajax requests.
+ *
+ * @since 3.4.0
+ *
+ * @param callable $function Callback function name.
+ */
+ $function = apply_filters( 'wp_die_ajax_handler', '_ajax_wp_die_handler' );
+ } elseif ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) {
+ /**
+ * Filters the callback for killing WordPress execution for XML-RPC requests.
+ *
+ * @since 3.4.0
+ *
+ * @param callable $function Callback function name.
+ */
+ $function = apply_filters( 'wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler' );
+ } else {
+ /**
+ * Filters the callback for killing WordPress execution for all non-Ajax, non-XML-RPC requests.
+ *
+ * @since 3.0.0
+ *
+ * @param callable $function Callback function name.
+ */
+ $function = apply_filters( 'wp_die_handler', '_default_wp_die_handler' );
+ }
+
+ call_user_func( $function, $message, $title, $args );
+}
+
+/**
+ * Kills WordPress execution and display HTML message with error message.
+ *
+ * This is the default handler for wp_die if you want a custom one for your
+ * site then you can overload using the {@see 'wp_die_handler'} filter in wp_die().
+ *
+ * @since 3.0.0
+ * @access private
+ *
+ * @param string|WP_Error $message Error message or WP_Error object.
+ * @param string $title Optional. Error title. Default empty.
+ * @param string|array $args Optional. Arguments to control behavior. Default empty array.
+ */
+function _default_wp_die_handler( $message, $title = '', $args = array() ) {
+ $defaults = array( 'response' => 500 );
+ $r = wp_parse_args($args, $defaults);
+
+ $have_gettext = function_exists('__');
+
+ if ( function_exists( 'is_wp_error' ) && is_wp_error( $message ) ) {
+ if ( empty( $title ) ) {
+ $error_data = $message->get_error_data();
+ if ( is_array( $error_data ) && isset( $error_data['title'] ) )
+ $title = $error_data['title'];
+ }
+ $errors = $message->get_error_messages();
+ switch ( count( $errors ) ) {
+ case 0 :
+ $message = '';
+ break;
+ case 1 :
+ $message = "<p>{$errors[0]}</p>";
+ break;
+ default :
+ $message = "<ul>\n\t\t<li>" . join( "</li>\n\t\t<li>", $errors ) . "</li>\n\t</ul>";
+ break;
+ }
+ } elseif ( is_string( $message ) ) {
+ $message = "<p>$message</p>";
+ }
+
+ if ( isset( $r['back_link'] ) && $r['back_link'] ) {
+ $back_text = $have_gettext? __('« Back') : '« Back';
+ $message .= "\n<p><a href='javascript:history.back()'>$back_text</a></p>";
+ }
+
+ if ( ! did_action( 'admin_head' ) ) :
+ if ( !headers_sent() ) {
+ status_header( $r['response'] );
+ nocache_headers();
+ header( 'Content-Type: text/html; charset=utf-8' );
+ }
+
+ if ( empty($title) )
+ $title = $have_gettext ? __('WordPress › Error') : 'WordPress › Error';
+
+ $text_direction = 'ltr';
+ if ( isset($r['text_direction']) && 'rtl' == $r['text_direction'] )
+ $text_direction = 'rtl';
+ elseif ( function_exists( 'is_rtl' ) && is_rtl() )
+ $text_direction = 'rtl';
+?>
+<!DOCTYPE html>
+<!-- Ticket #11289, IE bug fix: always pad the error page with enough characters such that it is greater than 512 bytes, even after gzip compression abcdefghijklmnopqrstuvwxyz1234567890aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz11223344556677889900abacbcbdcdcededfefegfgfhghgihihjijikjkjlklkmlmlnmnmononpopoqpqprqrqsrsrtstsubcbcdcdedefefgfabcadefbghicjkldmnoepqrfstugvwxhyz1i234j567k890laabmbccnddeoeffpgghqhiirjjksklltmmnunoovppqwqrrxsstytuuzvvw0wxx1yyz2z113223434455666777889890091abc2def3ghi4jkl5mno6pqr7stu8vwx9yz11aab2bcc3dd4ee5ff6gg7hh8ii9j0jk1kl2lmm3nnoo4p5pq6qrr7ss8tt9uuvv0wwx1x2yyzz13aba4cbcb5dcdc6dedfef8egf9gfh0ghg1ihi2hji3jik4jkj5lkl6kml7mln8mnm9ono
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" <?php if ( function_exists( 'language_attributes' ) && function_exists( 'is_rtl' ) ) language_attributes(); else echo "dir='$text_direction'"; ?>>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta name="viewport" content="width=device-width">
+ <?php
+ if ( function_exists( 'wp_no_robots' ) ) {
+ wp_no_robots();
+ }
+ ?>
+ <title><?php echo $title ?></title>
+ <style type="text/css">
+ html {
+ background: #f1f1f1;
+ }
+ body {
+ background: #fff;
+ color: #444;
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
+ margin: 2em auto;
+ padding: 1em 2em;
+ max-width: 700px;
+ -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.13);
+ box-shadow: 0 1px 3px rgba(0,0,0,0.13);
+ }
+ h1 {
+ border-bottom: 1px solid #dadada;
+ clear: both;
+ color: #666;
+ font-size: 24px;
+ margin: 30px 0 0 0;
+ padding: 0;
+ padding-bottom: 7px;
+ }
+ #error-page {
+ margin-top: 50px;
+ }
+ #error-page p {
+ font-size: 14px;
+ line-height: 1.5;
+ margin: 25px 0 20px;
+ }
+ #error-page code {
+ font-family: Consolas, Monaco, monospace;
+ }
+ ul li {
+ margin-bottom: 10px;
+ font-size: 14px ;
+ }
+ a {
+ color: #0073aa;
+ }
+ a:hover,
+ a:active {
+ color: #00a0d2;
+ }
+ a:focus {
+ color: #124964;
+ -webkit-box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, .8);
+ box-shadow:
+ 0 0 0 1px #5b9dd9,
+ 0 0 2px 1px rgba(30, 140, 190, .8);
+ outline: none;
+ }
+ .button {
+ background: #f7f7f7;
+ border: 1px solid #ccc;
+ color: #555;
+ display: inline-block;
+ text-decoration: none;
+ font-size: 13px;
+ line-height: 26px;
+ height: 28px;
+ margin: 0;
+ padding: 0 10px 1px;
+ cursor: pointer;
+ -webkit-border-radius: 3px;
+ -webkit-appearance: none;
+ border-radius: 3px;
+ white-space: nowrap;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+
+ -webkit-box-shadow: 0 1px 0 #ccc;
+ box-shadow: 0 1px 0 #ccc;
+ vertical-align: top;
+ }
+
+ .button.button-large {
+ height: 30px;
+ line-height: 28px;
+ padding: 0 12px 2px;
+ }
+
+ .button:hover,
+ .button:focus {
+ background: #fafafa;
+ border-color: #999;
+ color: #23282d;
+ }
+
+ .button:focus {
+ border-color: #5b9dd9;
+ -webkit-box-shadow: 0 0 3px rgba( 0, 115, 170, .8 );
+ box-shadow: 0 0 3px rgba( 0, 115, 170, .8 );
+ outline: none;
+ }
+
+ .button:active {
+ background: #eee;
+ border-color: #999;
+ -webkit-box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 );
+ box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.5 );
+ -webkit-transform: translateY(1px);
+ -ms-transform: translateY(1px);
+ transform: translateY(1px);
+ }
+
+ <?php
+ if ( 'rtl' == $text_direction ) {
+ echo 'body { font-family: Tahoma, Arial; }';
+ }
+ ?>
+ </style>
+</head>
+<body id="error-page">
+<?php endif; // ! did_action( 'admin_head' ) ?>
+ <?php echo $message; ?>
+</body>
+</html>
+<?php
+ die();
+}
+
+/**
+ * Kill WordPress execution and display XML message with error message.
+ *
+ * This is the handler for wp_die when processing XMLRPC requests.
+ *
+ * @since 3.2.0
+ * @access private
+ *
+ * @global wp_xmlrpc_server $wp_xmlrpc_server
+ *
+ * @param string $message Error message.
+ * @param string $title Optional. Error title. Default empty.
+ * @param string|array $args Optional. Arguments to control behavior. Default empty array.
+ */
+function _xmlrpc_wp_die_handler( $message, $title = '', $args = array() ) {
+ global $wp_xmlrpc_server;
+ $defaults = array( 'response' => 500 );
+
+ $r = wp_parse_args($args, $defaults);
+
+ if ( $wp_xmlrpc_server ) {
+ $error = new IXR_Error( $r['response'] , $message);
+ $wp_xmlrpc_server->output( $error->getXml() );
+ }
+ die();
+}
+
+/**
+ * Kill WordPress ajax execution.
+ *
+ * This is the handler for wp_die when processing Ajax requests.
+ *
+ * @since 3.4.0
+ * @access private
+ *
+ * @param string $message Error message.
+ * @param string $title Optional. Error title (unused). Default empty.
+ * @param string|array $args Optional. Arguments to control behavior. Default empty array.
+ */
+function _ajax_wp_die_handler( $message, $title = '', $args = array() ) {
+ $defaults = array(
+ 'response' => 200,
+ );
+ $r = wp_parse_args( $args, $defaults );
+
+ if ( ! headers_sent() && null !== $r['response'] ) {
+ status_header( $r['response'] );
+ }
+
+ if ( is_scalar( $message ) )
+ die( (string) $message );
+ die( '0' );
+}
+
+/**
+ * Kill WordPress execution.
+ *
+ * This is the handler for wp_die when processing APP requests.
+ *
+ * @since 3.4.0
+ * @access private
+ *
+ * @param string $message Optional. Response to print. Default empty.
+ */
+function _scalar_wp_die_handler( $message = '' ) {
+ if ( is_scalar( $message ) )
+ die( (string) $message );
+ die();
+}
+
+/**
+ * Encode a variable into JSON, with some sanity checks.