get_the_modified_date example

$classes[] = 'has-text-align-' . $attributes['textAlign'];
    }
    if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) {
        $classes[] = 'has-link-color';
    }

    /* * If the "Display last modified date" setting is enabled, * only display the modified date if it is later than the publishing date. */
    if ( isset( $attributes['displayType'] ) && 'modified' === $attributes['displayType'] ) {
        if ( get_the_modified_date( 'Ymdhi', $post_ID ) > get_the_date( 'Ymdhi', $post_ID ) ) {
            $formatted_date   = get_the_modified_date( empty( $attributes['format'] ) ? '' : $attributes['format']$post_ID );
            $unformatted_date = esc_attr( get_the_modified_date( 'c', $post_ID ) );
            $classes[]        = 'wp-block-post-date__modified-date';
        } else {
            return '';
        }
    }

    $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ) ) );

    if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) {
        

function the_modified_date( $format = '', $before = '', $after = '', $display = true ) {
    $the_modified_date = $before . get_the_modified_date( $format ) . $after;

    /** * Filters the date a post was last modified for display. * * @since 2.1.0 * * @param string|false $the_modified_date The last modified date or false if no post is found. * @param string $format PHP date format. * @param string $before HTML output before the date. * @param string $after HTML output after the date. */
    
Home | Imprint | This part of the site doesn't use cookies.