Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1464---Adding-publish-and-updated-dates-dc #2368

Open
wants to merge 4 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions wp-content/plugins/wporg-learn/views/block-lesson-plan-details.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/**
* @var array $details
*/
$is_updated = get_the_modified_date( 'ymd' ) != get_the_date( 'ymd' );

?>

Expand Down Expand Up @@ -37,5 +38,22 @@
}
}
?>
<!-- Date and modified date -->
<li>
<b><?php esc_html_e( 'Published', 'wporg-learn' ); ?></b>
<span>
<?php echo esc_html( get_the_date() ); ?>
</span>
</li>
<?php if ( $is_updated ) : ?>
<li>
<b><?php esc_html_e( 'Updated', 'wporg-learn' ); ?></b>
<span>
<?php echo esc_html( get_the_modified_date() ); ?>
</span>
</li>
<?php endif; ?>
<!-- END Date and modified date -->

</ul>
<?php endif; ?>
18 changes: 18 additions & 0 deletions wp-content/plugins/wporg-learn/views/block-workshop-details.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*/

$has_transcript = false !== strpos( $post->post_content, 'id="transcript"' );
$is_updated = get_the_modified_date( 'ymd' ) != get_the_date( 'ymd' );

?>

Expand Down Expand Up @@ -68,6 +69,23 @@
</ul>
<?php endif; ?>

<!-- Date and modified date -->
<li>
<b><?php esc_html_e( 'Published', 'wporg-learn' ); ?></b>
<span>
<?php echo esc_html( get_the_date() ); ?>
</span>
</li>
<?php if ( $is_updated ) : ?>
<li>
<b><?php esc_html_e( 'Updated', 'wporg-learn' ); ?></b>
<span>
<?php echo esc_html( get_the_modified_date() ); ?>
</span>
</li>
<?php endif; ?>
<!-- END Date and modified date -->

<?php if ( ! empty( $quiz_url ) ) : ?>
<div class="wp-block-button is-style-primary-full-width">
<a class="wp-block-button__link" href="<?php echo esc_attr( $quiz_url ); ?>" style="border-radius:5px">
Expand Down
Loading