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 ) {
- if( empty ($content) ){
- $post_date = sprintf(
- '<time class="entry-date published" datetime="%1$s">%2$s</time>',
- esc_attr( get_the_date( 'c' ) ),
- esc_html( get_the_date( '' ) )
- );
- return $post_date;
- }
- }
- return $content;
- }, 10, 3);
Advertisement
Add Comment
Please, Sign In to add comment