Handles formatting a date via AJAX.
Source
function wp_ajax_date_format() {
wp_die( date_i18n( sanitize_option( 'date_format', wp_unslash( $_POST['date'] ) ) ) );
}
Changelog
Version | Description |
---|---|
3.1.0 | Introduced. |
CARVIEW |
Handles formatting a date via AJAX.
function wp_ajax_date_format() {
wp_die( date_i18n( sanitize_option( 'date_format', wp_unslash( $_POST['date'] ) ) ) );
}
Uses | Description |
---|---|
sanitize_option()wp-includes/formatting.php | Sanitizes various option values based on the nature of the option. |
date_i18n()wp-includes/functions.php | Retrieves the date in localized format, based on a sum of Unix timestamp and timezone offset in seconds. |
wp_unslash()wp-includes/formatting.php | Removes slashes from a string or recursively removes slashes from strings within an array. |
wp_die()wp-includes/functions.php | Kills WordPress execution and displays HTML page with an error message. |
Version | Description |
---|---|
3.1.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.