blob: 76acb6c7d87c0cef8bf60fae22ea184c122b0dbd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
<?php
/**
* Class WP_Sitemaps_Large_Test_Provider.
*
* Provides test data for additional registered providers.
*/
class WP_Sitemaps_Large_Test_Provider extends WP_Sitemaps_Provider {
/**
* Number of entries in the sitemap the provider produces.
*
* @var integer
*/
public $num_entries = 1;
/**
* WP_Sitemaps_Large_Test_Provider constructor.
*
* @param int $num_entries Optional. Number of entries in in the sitemap.
*/
public function __construct( $num_entries = 50001 ) {
$this->name = 'tests';
$this->object_type = 'test';
$this->num_entries = $num_entries;
}
/**
* Gets a URL list for a sitemap.
*
* @param int $page_num Page of results.
* @param string $object_subtype Optional. Object subtype name. Default empty.
* @return array[] Array of URL information for a sitemap.
*/
public function get_url_list( $page_num, $object_subtype = '' ) {
return array_fill( 0, $this->num_entries, array( 'loc' => home_url( '/' ) ) );
}
/**
* Lists sitemap pages exposed by this provider.
*
* The returned data is used to populate the sitemap entries of the index.
*
* @return array[] Array of sitemap entries.
*/
public function get_sitemap_entries() {
return array_fill( 0, $this->num_entries, array( 'loc' => home_url( '/' ) ) );
}
/**
* Query for determining the number of pages.
*
* @param string $object_subtype Optional. Object subtype. Default empty.
* @return int Total number of pages.
*/
public function get_max_num_pages( $object_subtype = '' ) {
return $this->num_entries;
}
}
|