Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions functionMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
'check_admin_referer' => ['1|2|false', 'action' => 'string'],
'check_ajax_referer' => ['1|2|false', 'action' => 'string'],
'comment_class' => ['($display is true ? void : string)'],
'current_action' => ['non-empty-string|false'],
'current_filter' => ['non-empty-string|false'],
'current_time' => ["(\$type is 'timestamp'|'U' ? int : string)"],
'did_action' => ['int<0, max>'],
'edit_link' => ['int<0, max>'],
Expand Down
10 changes: 10 additions & 0 deletions tests/data/return/current-action.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

namespace PhpStubs\WordPress\Core\Tests;

use function current_action;
use function PHPStan\Testing\assertType;

assertType('non-empty-string|false', current_action());
10 changes: 10 additions & 0 deletions tests/data/return/current-filter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

namespace PhpStubs\WordPress\Core\Tests;

use function current_filter;
use function PHPStan\Testing\assertType;

assertType('non-empty-string|false', current_filter());
2 changes: 2 additions & 0 deletions wordpress-stubs.php
Original file line number Diff line number Diff line change
Expand Up @@ -129508,6 +129508,7 @@ function remove_all_filters($hook_name, $priority = \false)
* @global string[] $wp_current_filter Stores the list of current filters with the current one last
*
* @return string Hook name of the current filter.
* @phpstan-return non-empty-string|false
*/
function current_filter()
{
Expand Down Expand Up @@ -129696,6 +129697,7 @@ function remove_all_actions($hook_name, $priority = \false)
* @since 3.9.0
*
* @return string Hook name of the current action.
* @phpstan-return non-empty-string|false
*/
function current_action()
{
Expand Down