wp = $wp; $this->batch_size = max( 1, (int) $batch_size ); } /** * {@inheritdoc} */ public function urls() { foreach ( $this->wp->public_taxonomies() as $taxonomy ) { $after_id = 0; do { $rows = $this->wp->term_rows( $taxonomy, $after_id, $this->batch_size ); $full_batch = count( $rows ) === $this->batch_size; foreach ( $rows as $row ) { $after_id = $row['id']; $link = $this->wp->term_link( $row['id'], $taxonomy ); if ( null === $link ) { continue; } yield new DiscoveredUrl( $link, 'term', 'term', $row['id'] ); yield from Pagination::urls( $this->wp, $link, $row['count'] ); } } while ( $full_batch ); } } }