Make WordPress Core

Ticket #40790: 40790.patch

File 40790.patch, 967 bytes (added by keraweb, 5 years ago)

Add filter _get_last_post_time_post_type

  • wp-includes/post.php

     
    1 <?php
     1<?php
    22/**
    33 * Core Post API
    44 *
     
    62496249
    62506250        $timezone = strtolower( $timezone );
    62516251
     6252        /**
     6253         * Filter the post type of which to get the latest modified or published time.
     6254         *
     6255         * @since 5.x
     6256         *
     6257         * @param string $post_type Optional. The post type to check. Default 'any'.
     6258         * @param string $timezone  The timezone for the timestamp. See get_lastpostdate().
     6259         *                          for information on accepted values.
     6260         * @param string $field     Post field to check: 'date' or 'modified'.
     6261         * @return string
     6262         */
     6263        $post_type = apply_filters( '_get_last_post_time_post_type', $post_type, $timezone, $field );
     6264
    62526265        $key = "lastpost{$field}:$timezone";
    62536266        if ( 'any' !== $post_type ) {
    62546267                $key .= ':' . sanitize_key( $post_type );