Plugin Directory

Changeset 3474236


Ignore:
Timestamp:
03/04/2026 07:01:05 AM (5 weeks ago)
Author:
cifi
Message:

Fix - patterns current post bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • squirrly-seo/tags/12.4.15/models/domain/Patterns.php

    r3459575 r3474236  
    2222
    2323    public function getDate() {
    24         if ( isset($this->_currentpost->post_date) && $this->_currentpost->post_date ) {
    25             return wp_date( 'c', strtotime( $this->_currentpost->post_date ) );
     24        $post = $this->currentpost;
     25
     26        if ( isset($post->post_date) && $post->post_date ) {
     27            return wp_date( 'c', strtotime( $post->post_date ) );
    2628        } elseif ( $this->_date ) {
    2729            return wp_date( 'c', strtotime( $this->_date ) );
     
    514516
    515517    public function getModified() {
    516         if ( isset( $this->_currentpost->post_modified ) && $this->_currentpost->post_modified ) {
    517             return wp_date( 'c', strtotime( $this->_currentpost->post_modified ) );
     518        $post = $this->currentpost;
     519
     520        if ( isset( $post->post_modified ) && $post->post_modified ) {
     521            return wp_date( 'c', strtotime( $post->post_modified ) );
    518522        } elseif ( $this->_modified ) {
    519523            return wp_date( 'c', strtotime( $this->_modified ) );
Note: See TracChangeset for help on using the changeset viewer.