diff --git a/composer.json b/composer.json index 98a1e7d0..c333a62a 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "phpcompatibility/phpcompatibility-wp": "^2.1", "phpro/grumphp-shim": "^2.6", "roave/security-advisories": "dev-latest", - "wp-coding-standards/wpcs": "3.3.0", + "wp-coding-standards/wpcs": "3.4.1", "wp-plugin/advanced-custom-fields": "6.8.4" }, "scripts": { diff --git a/functions.php b/functions.php index 623b7b9c..a87370d4 100644 --- a/functions.php +++ b/functions.php @@ -27,6 +27,7 @@ function () { } ); require_once __DIR__ . '/inc/Helpers/Svg.php'; +require_once __DIR__ . '/inc/Helpers/Formatting/Datetime.php'; require_once __DIR__ . '/inc/Helpers/Formatting/Escape.php'; require_once __DIR__ . '/inc/Helpers/Formatting/Image.php'; require_once __DIR__ . '/inc/Helpers/Formatting/Link.php'; diff --git a/inc/Helpers/Formatting/Datetime.php b/inc/Helpers/Formatting/Datetime.php new file mode 100644 index 00000000..40d30616 --- /dev/null +++ b/inc/Helpers/Formatting/Datetime.php @@ -0,0 +1,86 @@ + markup. + * + * @usage BEA\Theme\Framework\Helpers\Formatting\Datetime\the_datetime( get_the_date( 'd.m.Y' ), [ 'datetime' => get_the_date( 'Y-m-d' ), 'class' => 'crd__date' ] ); + * + * @param string $display_date Formatted date string shown to users. + * @param array $settings { + * Optional. Settings for the datetime markup. + * + * @type string $before Markup before the