Making WordPress.org

Changeset 10723


Ignore:
Timestamp:
02/25/2021 07:33:46 AM (6 years ago)
Author:
dd32
Message:

Theme Directory: Add a 'creation_time' field and 'last_updated_time' field in API responses.

The creation time is when the post was first published.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-themes-api.php

    r10722 r10723  
    4646                'downloadlink'       => false,
    4747                'last_updated'       => false,
     48                'creation_time'      => false,
    4849                'parent'             => false,
    4950                'rating'             => false,
     
    435436                        $defaults['requires'] = true;
    436437                        $defaults['requires_php'] = true;
     438                        $defaults['creation_time'] = true;
    437439                }
    438440
     
    771773
    772774                if ( $this->fields['last_updated'] ) {
    773                         $phil->last_updated = get_post_modified_time( 'Y-m-d', null, $theme->ID, true );
     775                        $phil->last_updated      = get_post_modified_time( 'Y-m-d', true, $theme->ID, true );
     776                        $phil->last_updated_time = get_post_modified_time( 'Y-m-d H:i:s', true, $theme->ID, true );
     777                }
     778
     779                if ( $this->fields['creation_time'] ) {
     780                        $phil->creation_time = get_post_time( 'Y-m-d H:i:s', true, $theme->ID, true );
    774781                }
    775782
Note: See TracChangeset for help on using the changeset viewer.