forked from WordPress/wordpress-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvars.php
More file actions
84 lines (76 loc) · 1.32 KB
/
vars.php
File metadata and controls
84 lines (76 loc) · 1.32 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
/**
* Tests to make sure query vars are as expected.
*
* @group query
*/
class Tests_Query_Vars extends WP_UnitTestCase {
/**
* @ticket 35115
* @ticket 51154
*/
public function testPublicQueryVarsAreAsExpected() {
global $wp;
// Re-initialise any dynamically-added public query vars:
do_action( 'init' );
$this->assertSame(
array(
// Static public query vars:
'm',
'p',
'posts',
'w',
'cat',
'withcomments',
'withoutcomments',
's',
'search',
'exact',
'sentence',
'calendar',
'page',
'paged',
'more',
'tb',
'pb',
'author',
'order',
'orderby',
'year',
'monthnum',
'day',
'hour',
'minute',
'second',
'name',
'category_name',
'tag',
'feed',
'author_name',
'pagename',
'page_id',
'error',
'attachment',
'attachment_id',
'subpost',
'subpost_id',
'preview',
'robots',
'favicon',
'taxonomy',
'term',
'cpage',
'post_type',
'embed',
// Dynamically added public query vars:
'post_format',
'rest_route',
'sitemap',
'sitemap-subtype',
'sitemap-stylesheet',
),
$wp->public_query_vars,
'Care should be taken when introducing new public query vars. See https://core.trac.wordpress.org/ticket/35115'
);
}
}