Skip to content

Commit a2c6c10

Browse files
committed
Fixed error trying to use $this in method args
1 parent c912c19 commit a2c6c10

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Posts/Post.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,10 @@ public function excerpt()
6969
* @param string $format
7070
* @return string
7171
*/
72-
public function publishDate($format = $this->date_format)
72+
public function publishDate($format = null)
7373
{
74+
$format = ($format ?: $this->date_format);
75+
7476
return \get_the_date($format, $this->id);
7577
}
7678

@@ -80,8 +82,10 @@ public function publishDate($format = $this->date_format)
8082
* @param string $format
8183
* @return string
8284
*/
83-
public function modifiedDate($format = $this->date_format)
85+
public function modifiedDate($format = null)
8486
{
87+
$format = ($format ?: $this->date_format);
88+
8589
return \get_the_modified_time($format, $this->id);
8690
}
8791

0 commit comments

Comments
 (0)