• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Jetpack a2z

Jetpack a2z

Jetpack a2z

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / Jetpack_Sitemap_Librarian::query_latest_approved_comment_time_on_post() – Get the most recent timestamp among approved comments for the given post_id.

You appear to be a bot. Output may be restricted

Description

Get the most recent timestamp among approved comments for the given post_id.

Usage

$int = Jetpack_Sitemap_Librarian::query_latest_approved_comment_time_on_post( $post_id );

Parameters

$post_id
( int ) required – Post identifier.

Returns

int Timestamp in 'Y-m-d h:i:s' format (UTC) of the most recent comment on the given post, or null if no such comments exist.

Source

File name: jetpack/modules/sitemaps/sitemap-librarian.php
Lines:

1 to 12 of 12
  public function query_latest_approved_comment_time_on_post( $post_id ) {
    global $wpdb;

    return $wpdb->get_var(
      $wpdb->prepare(
        "SELECT MAX(comment_date_gmt)
					FROM $wpdb->comments
					WHERE comment_post_ID = %d AND comment_approved = '1' AND comment_type in ( '', 'comment' )",
        $post_id
      )
    );
  }
 

 View on GitHub View on Trac

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Pinterest (Opens in new window)

Related

Published: 27 November 2019 | Last updated: 6 May 2020

Primary Sidebar

Information

Function name: Jetpack_Sitemap_Librarian::query_latest_approved_comment_time_on_post
Class ref: Jetpack_Sitemap_Librarian
Plugin ref: Jetpack
Version: 9.4
Sourcefile: modules/sitemaps/sitemap-librarian.php
File ref: modules/sitemaps/sitemap-librarian.php
Deprecated?: No
API Letters: J,L,Q,S

Footer

Jetpack a2z
Jetpack a2z
Jetpack a2z
WordPress 5.6.2
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  jetpack.wp-a2z.org
© Copyright Jetpack a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites