Skip to content

Instantly share code, notes, and snippets.

@yousufansa
Created December 2, 2020 05:35
Show Gist options
  • Select an option

  • Save yousufansa/d0e63928ea647b47be7bf44b1420428d to your computer and use it in GitHub Desktop.

Select an option

Save yousufansa/d0e63928ea647b47be7bf44b1420428d to your computer and use it in GitHub Desktop.
Vodi - Display Person Died on Single Person
if ( ! function_exists( 'vodi_child_single_person_deathday' ) ) {
/**
* Person deathday in the single person.
*/
function vodi_child_single_person_deathday() {
global $person;
$deathday = $person->get_deathday();
if( ! empty( $deathday ) ) :
$date = $deathday->getOffsetTimestamp();
$title = apply_filters( 'vodi_child_single_person_deathday_title_text', __( 'Died', 'masvideos' ) );
$format = apply_filters( 'vodi_child_single_person_deathday_format', 'd-m-Y' );
?>
<div class="single-person__deathday">
<h4 class="single-person__sidebar-title deathday-title"><?php echo esc_html( $title ); ?></h4>
<?php echo date_i18n( $format, $date ); ?>
</div>
<?php
endif;
}
}
add_action( 'masvideos_template_single_person_content_sidebar', 'vodi_child_single_person_deathday', 55 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment