Skip to content

Commit

Permalink
Merge pull request #77 from Strategy11/fix-3174
Browse files Browse the repository at this point in the history
Prevent PHP notices if ad dates are not set
  • Loading branch information
sorinmarta authored Dec 11, 2024
2 parents d65f545 + 585ecff commit dd9da12
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions frontend/class-awpcp-meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ public function generate_basic_meta_tags() {
}

public function get_the_date( $the_date, $format = '' ) {
if ( empty( $this->properties['published-time'] ) ) {
return $the_date;
}

if ( ! $format ) {
$format = get_option( 'date_format' );
}
Expand All @@ -250,6 +254,10 @@ public function get_the_date( $the_date, $format = '' ) {
}

public function get_the_modified_date( $the_date, $format ) {
if ( empty( $this->properties['modified-time'] ) ) {
return $the_date;
}

if ( ! $format ) {
$format = get_option( 'date_format' );
}
Expand Down

0 comments on commit dd9da12

Please sign in to comment.