Yoast\WP\SEO\Repositories

Indexable_Cleanup_Repository::update_indexables_author_to_reassigned()publicYoast 1.0

Updates the author_id of indexables which author_id is not in the wp_users table with the id of the reassingned user.

Метод класса: Indexable_Cleanup_Repository{}

Хуков нет.

Возвращает

int|true|false. The number of updated rows, false if query to get data fails.

Использование

$Indexable_Cleanup_Repository = new Indexable_Cleanup_Repository();
$Indexable_Cleanup_Repository->update_indexables_author_to_reassigned( $limit );
$limit(int) (обязательный)
The limit we'll apply to the queries.

Код Indexable_Cleanup_Repository::update_indexables_author_to_reassigned() Yoast 24.4

public function update_indexables_author_to_reassigned( $limit ) {
	// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching -- Reason: Already prepared.
	$reassigned_authors_objs = $this->get_reassigned_authors( $limit );

	if ( $reassigned_authors_objs === false ) {
		return false;
	}

	return $this->update_indexable_authors( $reassigned_authors_objs, $limit );
}