Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('generateblocks_dynamic_content_output', function($content, $attributes, $block){
- if ( ! empty( $attributes['className'] ) && strpos( $attributes['className'], 'my-date' ) !== false ) {
- $timestamp = strtotime($content);
- $new_date = date("d-m-Y", $timestamp);
- $my_date = sprintf(
- '<time datetime="%1$s">%2$s</time>',
- date('c', $timestamp),
- date('l F j, Y', $timestamp) );
- return $my_date;
- }
- return $content;
- }, 10, 3);
Advertisement
Add Comment
Please, Sign In to add comment