/ protected function get_index_item_url( $type, $sitemap_num ) { return home_url( "/$type-sitemap$sitemap_num.xml" ); } /** * Creates index items for the given type. * * @param string $type The type of items. * * @return array The index items. */ protected function make_index_items( $type ) { $per_sitemap = Utils::get_items_per_sitemap(); $item_count = $this->get_item_count( $type ); if ( empty( $per_sitemap ) ) { return array(); } $sitemap_count = (int) ceil( $item_count / $per_sitemap ); $index_items = array(); for ( $sitemap_num = 1; $sitemap_num <= $sitemap_count; $sitemap_num++ ) { $location = $this->get_index_item_url( $type, $sitemap_num ); $index_item = new Index_Item(); $index_item->set_location( $location ); $index_items[] = $index_item; } return $index_items; } }