• 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_sitemaps_after_id() – Retrieve an array of sitemap rows (of a given type) sorted by ID.

You appear to be a bot. Output may be restricted

Description

Retrieve an array of sitemap rows (of a given type) sorted by ID.

Returns the smallest $num_posts sitemap rows (measured by ID) of the given type which are larger than $from_id.

Usage

$array = Jetpack_Sitemap_Librarian::query_sitemaps_after_id( $type, $from_id, $num_posts );

Parameters

$type
( string ) required – Type of the sitemap rows to retrieve.
$from_id
( int ) required – Greatest lower bound of retrieved sitemap post IDs.
$num_posts
( int ) required – Largest number of sitemap posts to retrieve.

Returns

array The sitemaps, as an array of associative arrays.

Source

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

1 to 20 of 20
  public function query_sitemaps_after_id( $type, $from_id, $num_posts ) {
    global $wpdb;

    return $wpdb->get_results(
      $wpdb->prepare(
        "SELECT *
					FROM $wpdb->posts
					WHERE post_type=%s
						AND post_status=%s
						AND ID>%d
					ORDER BY ID ASC
					LIMIT %d;",
        $type,
        'draft',
        $from_id,
        $num_posts
      ),
      ARRAY_A
    ); // WPCS: db call ok; no-cache ok.
  }
 

 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: 27 November 2019

Primary Sidebar

Information

Function name: Jetpack_Sitemap_Librarian::query_sitemaps_after_id
Class ref: Jetpack_Sitemap_Librarian
Plugin ref: Jetpack
Version: 10.8
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.9.3
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-2022. All rights reserved.


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

  • Home
  • Blog
  • Sitemap
  • Sites