Skip to content

Commit 5040247

Browse files
committed
fix: Empty prefix fix
1 parent 195597b commit 5040247

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Decorators/Ajax_Action.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,16 @@ public function __construct(
110110
$this->hooks = $public ? array( 'wp_ajax_nopriv', 'wp_ajax' ) : array( 'wp_ajax' );
111111
$this->getter = Closure::fromCallable( $this->get_fetch_cb( $method ) );
112112

113+
[ $modifiers, $tag ] = '' !== $prefix
114+
? array( array( '%s', \rtrim( $prefix, '_' ), $action ), '%s_%s_%s' )
115+
: array( array( '%s', $action ), '%s_%s' );
116+
113117
parent::__construct(
114-
tag: '%s_%s_%s',
118+
tag: $tag,
115119
priority:$priority,
116120
context: self::CTX_AJAX,
117121
conditional: $conditional,
118-
modifiers: array( '%s', \rtrim( $prefix, '_' ), $action ),
122+
modifiers: $modifiers,
119123
invoke: self::INV_PROXIED,
120124
args: 0,
121125
params: $params,

0 commit comments

Comments
 (0)