Skip to content

Commit 84d45a5

Browse files
committed
Add Controller::getAdminAjaxUrl
This is needed for the AdminBar.
1 parent 0413221 commit 84d45a5

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/Controller.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,16 @@ public static function getAdminUrl( string $slug ): string {
301301
return admin_url( 'admin.php?page=' . $page );
302302
}
303303

304+
public static function getAdminAjaxUrl( string $slug ): string {
305+
if ( $slug === 'run' ) {
306+
$action = 'static-deploy';
307+
} else {
308+
$action = self::getHookName( $slug );
309+
}
310+
311+
return admin_url( 'admin-ajax.php?action=' . $action );
312+
}
313+
304314
public static function getAdminPostUrl( string $slug ): string {
305315
if ( $slug === 'run' ) {
306316
$page = 'static-deploy';

0 commit comments

Comments
 (0)