• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Yoast SEO a2z

Yoast SEO a2z

WordPress SEO a2z

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / Abstract_Indexing_Action::get_limited_unindexed_count() – Returns a limited number of unindexed posts.

You appear to be a bot. Output may be restricted

Description

Returns a limited number of unindexed posts.

Usage

$int = Abstract_Indexing_Action::get_limited_unindexed_count( $limit );

Parameters

$limit
( int ) required – Limit the maximum number of unindexed posts that are counted.

Returns

int The limited number of unindexed posts. 0 if the query fails.

Source

File name: wordpress-seo/src/actions/indexing/abstract-indexing-action.php


Lines:

1 to 19 of 19
  public function get_limited_unindexed_count( $limit ) {
    $transient = \get_transient( static::UNINDEXED_LIMITED_COUNT_TRANSIENT );
    if ( $transient !== false ) {
      return (int) $transient;
    }

    \set_transient( static::UNINDEXED_LIMITED_COUNT_TRANSIENT, 0, ( \MINUTE_IN_SECONDS * 15 ) );

    $query = $this->get_select_query( $limit );

    // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- Function get_count_query returns a prepared query.
    $unindexed_object_ids = $this->wpdb->get_col( $query );
    $count                = (int) \count( $unindexed_object_ids );

    \set_transient( static::UNINDEXED_LIMITED_COUNT_TRANSIENT, $count, ( \MINUTE_IN_SECONDS * 15 ) );

    return $count;
  }
 

 View on GitHub View on Trac

Published: 12th September 2021 | Last updated: 14th November 2021

Primary Sidebar

Information

Function name: Abstract_Indexing_Action::get_limited_unindexed_count
Class ref: Abstract_Indexing_Action
Plugin ref: Yoast SEO
Version: 20.2.1
Sourcefile: src/actions/indexing/abstract-indexing-action.php
File ref: src/actions/indexing/abstract-indexing-action.php
Deprecated?: No
API Letters: A,G,I,L

Footer

Yoast SEO a2z
Yoast SEO a2z
WordPress SEO a2z
WordPress 6.1.1
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:  wordpress-seo.wp-a2z.org
© Copyright Yoast SEO a2z 2017-2023. All rights reserved.


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

  • Home
  • Blog
  • Sitemap
  • Sites