• 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_Aioseo_Settings_Importing_Action::get_unimported_chunk() – Retrieves (a chunk of, if limit is applied) the unimported AIOSEO settings.

You appear to be a bot. Output may be restricted

Description

Retrieves (a chunk of, if limit is applied) the unimported AIOSEO settings.

To apply a chunk, we manipulate the cursor to the keys of the AIOSEO settings.

Usage

$array = Abstract_Aioseo_Settings_Importing_Action::get_unimported_chunk( $importable_data, $limit );

Parameters

$importable_data
( array ) required – All of the available AIOSEO settings.
$limit
( int ) required – The maximum number of unimported objects to be returned.

Returns

array The (chunk of, if limit is applied)) unimported AIOSEO settings.

Source

File name: wordpress-seo/src/actions/importing/aioseo/abstract-aioseo-settings-importing-action.php
Lines:

1 to 24 of 24
  protected function get_unimported_chunk( $importable_data, $limit ) {
    \ksort( $importable_data );

    $cursor_id = $this->get_cursor_id();
    $cursor    = $this->import_cursor->get_cursor( $cursor_id, '' );

    
/**
 * Filter 'wpseo_aioseo_<identifier>_import_cursor' - Allow filtering the value of the aioseo settings import cursor.
 *
 * @api int The value of the aioseo posttype default settings import cursor.
 */
    $cursor = \apply_filters( 'wpseo_aioseo_' . $this->get_type() . '_import_cursor', $cursor );

    if ( $cursor === '' ) {
      return \array_slice( $importable_data, 0, $limit, true );
    }

    // Let's find the position of the cursor in the alphabetically sorted importable data, so we can return only the unimported data.
    $keys = \array_flip( \array_keys( $importable_data ) );
    // If the stored cursor now no longer exists in the data, we have no choice but to start over.
    $position = ( isset( $keys[ $cursor ] ) ) ? ( $keys[ $cursor ] + 1 ) : 0;

    return \array_slice( $importable_data, $position, $limit, true );
  }
 

 View on GitHub View on Trac

Published: 25th January 2022 | Last updated: 15th March 2022

Primary Sidebar

Information

Function name: Abstract_Aioseo_Settings_Importing_Action::get_unimported_chunk
Class ref: Abstract_Aioseo_Settings_Importing_Action
Plugin ref: Yoast SEO
Version: 19.9
Sourcefile: src/actions/importing/aioseo/abstract-aioseo-settings-importing-action.php
File ref: src/actions/importing/aioseo/abstract-aioseo-settings-importing-action.php
Deprecated?: No
API Letters: A,I,S

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