WordPress как на ладони
Очень Удобный и Быстрый Хостинг для сайтов на WordPress. Пользуюсь сам и вам рекомендую!
функция не описана


Aioseo_Posts_Importing_Action::query() public Yoast 1.0

Creates a query for gathering AiOSEO data from the database.

Ищем WP-разработчика! Фулл-тайм, удаленка, хорошая зарплата, соц. пакет. Подробности.
Компания Boosta.

{} Это метод класса: Aioseo_Posts_Importing_Action{}

Хуки из метода


Строку. The query to use for importing or counting the number of items to import.


$Aioseo_Posts_Importing_Action = new Aioseo_Posts_Importing_Action();
$Aioseo_Posts_Importing_Action->query( $limit, $just_detect );
The maximum number of unimported objects to be returned.
По умолчанию: false
Whether we want to just detect if there are unimported objects. If false, we want to actually import them too.
По умолчанию: false

Код Aioseo_Posts_Importing_Action::query() Yoast 17.6

public function query( $limit = false, $just_detect = false ) {
	$table = $this->get_table();

	$select_statement = 'id';
	if ( ! $just_detect ) {
		// If we want to import too, we need the actual needed data from AIOSEO indexables.
		$needed_data = \array_keys( $this->aioseo_to_yoast_map );
		\array_push( $needed_data, 'id', 'post_id' );

		$select_statement = \implode( ', ', $needed_data );

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

	 * Filter 'wpseo_aioseo_post_cursor' - Allow filtering the value of the aioseo post import cursor.
	 * @api int The value of the aioseo post import cursor.
	$cursor = \apply_filters( 'wpseo_aioseo_post_import_cursor', $cursor );

	$replacements = [ $cursor ];

	$limit_statement = '';
	if ( ! empty( $limit ) ) {
		$replacements[]  = $limit;
		$limit_statement = ' LIMIT %d';

	// phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Reason: There is no unescaped user input.
	return $this->wpdb->prepare(
		"SELECT {$select_statement} FROM {$table} WHERE id > %d ORDER BY id{$limit_statement}",
	// phpcs:enable WordPress.DB.PreparedSQL.InterpolatedNotPrepared