Last active
June 29, 2023 14:52
-
-
Save fischgeek/62c8e6b91857e44257a4aae96e0d6f70 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function shortcode_custom_date($fmt) { | |
extract(shortcode_atts(array( | |
'format' => 'Ymd' | |
), $fmt)); | |
return date($format); | |
} | |
add_shortcode('custom_date', 'shortcode_custom_date'); | |
// usage: [custom_date format="r"] // Thu, 29 Jun 2023 14:49:05 +0000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment