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 ); }