File Editor
Directories:
.. (Back)
open-graph
schema
twitter
Files:
aioseo-helper.php
asset-helper.php
attachment-cleanup-helper.php
author-archive-helper.php
blocks-helper.php
capability-helper.php
crawl-cleanup-helper.php
curl-helper.php
current-page-helper.php
date-helper.php
environment-helper.php
first-time-configuration-notice-helper.php
home-url-helper.php
image-helper.php
import-cursor-helper.php
import-helper.php
indexable-helper.php
indexable-to-postmeta-helper.php
indexing-helper.php
language-helper.php
meta-helper.php
notification-helper.php
options-helper.php
pagination-helper.php
permalink-helper.php
post-helper.php
post-type-helper.php
primary-term-helper.php
product-helper.php
redirect-helper.php
require-file-helper.php
robots-helper.php
robots-txt-helper.php
sanitization-helper.php
score-icon-helper.php
short-link-helper.php
site-helper.php
social-profiles-helper.php
string-helper.php
taxonomy-helper.php
url-helper.php
user-helper.php
wincher-helper.php
woocommerce-helper.php
wordpress-helper.php
wpdb-helper.php
Create New File
Create
Edit File: import-cursor-helper.php
<?php namespace Yoast\WP\SEO\Helpers; /** * The Import Cursor Helper. */ class Import_Cursor_Helper { /** * The Options_Helper. * * @var Options_Helper */ public $options; /** * Class constructor. * * @param Options_Helper $options The options helper. */ public function __construct( Options_Helper $options ) { $this->options = $options; } /** * Returns the stored cursor value. * * @param string $cursor_id The cursor id. * @param mixed $default_value The default value if no cursor has been set yet. * * @return int The stored cursor value. */ public function get_cursor( $cursor_id, $default_value = 0 ) { $import_cursors = $this->options->get( 'import_cursors', [] ); return ( isset( $import_cursors[ $cursor_id ] ) ) ? $import_cursors[ $cursor_id ] : $default_value; } /** * Stores the current cursor value. * * @param string $cursor_id The cursor id. * @param int $last_imported_id The id of the lastly imported entry. * * @return void */ public function set_cursor( $cursor_id, $last_imported_id ) { $current_cursors = $this->options->get( 'import_cursors', [] ); if ( ! isset( $current_cursors[ $cursor_id ] ) || $current_cursors[ $cursor_id ] < $last_imported_id ) { $current_cursors[ $cursor_id ] = $last_imported_id; $this->options->set( 'import_cursors', $current_cursors ); } } }
Save Changes
Rename File
Rename