Skip to content

Commit b34b3d4

Browse files
authored
Update for get_calendar() function signature change (#279)
The `get_calendar()` function has been updated to accept a single array parameter `$args`, replacing the previous boolean parameters `$initial` and `$display`.
1 parent 8a25ff3 commit b34b3d4

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

functionMap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
'wp_set_comment_status' => ['($wp_error is false ? bool : true|\WP_Error)'],
158158
'comment_class' => ['($display is true ? void : string)'],
159159
'edit_term_link' => ['($display is true ? void : string|void)'],
160-
'get_calendar' => ['($display is true ? void : string)'],
160+
'get_calendar' => ['($args is array{display: false}&array ? string : void)'],
161161
'next_posts' => ['($display is true ? void : string)'],
162162
'post_type_archive_title' => ['($display is true ? void : string|void)'],
163163
'previous_posts' => ['($display is true ? void : string)'],

tests/data/echo_parameter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
$value = true;
4848
assertType('null', comment_class('', null, null, $value));
4949
assertType('null', edit_term_link('', '', '', null, $value));
50-
assertType('null', get_calendar(true, $value));
50+
assertType('null', get_calendar(['initial' => true, 'display' => $value]));
5151
assertType('null', next_posts(0, $value));
5252
assertType('null', post_type_archive_title('', $value));
5353
assertType('null', previous_posts($value));
@@ -67,7 +67,7 @@
6767
$value = false;
6868
assertType('string', comment_class('', null, null, $value));
6969
assertType('string|null', edit_term_link('', '', '', null, $value));
70-
assertType('string', get_calendar(true, $value));
70+
assertType('string', get_calendar(['initial' => true, 'display' => $value]));
7171
assertType('string', next_posts(0, $value));
7272
assertType('string|null', post_type_archive_title('', $value));
7373
assertType('string', previous_posts(false));
@@ -87,7 +87,7 @@
8787
$value = Faker::bool();
8888
assertType('string|null', comment_class('', null, null, $value));
8989
assertType('string|null', edit_term_link('', '', '', null, $value));
90-
assertType('string|null', get_calendar(true, $value));
90+
assertType('string|null', get_calendar(['initial' => true, 'display' => $value]));
9191
assertType('string|null', next_posts(0, $value));
9292
assertType('string|null', post_type_archive_title('', $value));
9393
assertType('string|null', previous_posts($value));

wordpress-stubs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115464,7 +115464,7 @@ function calendar_week_mod($num)
115464115464
* display?: bool,
115465115465
* post_type?: string,
115466115466
* } $args
115467-
* @phpstan-return ($display is true ? void : string)
115467+
* @phpstan-return ($args is array{display: false}&array ? string : void)
115468115468
*/
115469115469
function get_calendar($args = array())
115470115470
{

0 commit comments

Comments
 (0)