Skip to content

Commit 374b62a

Browse files
committed
Configure options page.
1 parent 4fe75e0 commit 374b62a

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

src/Controller.php

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ public function run() : void {
2020
1
2121
);
2222

23+
add_action(
24+
'admin_menu',
25+
[ $this, 'addOptionsPage' ],
26+
15,
27+
1
28+
);
29+
2330
do_action(
2431
'wp2static_register_addon',
2532
'wp2static-addon-s3',
@@ -428,7 +435,7 @@ public static function saveOptionsFromUI() : void {
428435
[ 'name' => 'cfMaxPathsToInvalidate' ]
429436
);
430437

431-
wp_safe_redirect( admin_url( 'admin.php?page=wp2static-s3' ) );
438+
wp_safe_redirect( admin_url( 'admin.php?page=wp2static-addon-s3' ) );
432439
exit;
433440
}
434441

@@ -455,5 +462,15 @@ public static function getValue( string $name ) : string {
455462

456463
return $option_value;
457464
}
458-
}
459465

466+
public function addOptionsPage() : void {
467+
add_submenu_page(
468+
null,
469+
'S3 Deployment Options',
470+
'S3 Deployment Options',
471+
'manage_options',
472+
'wp2static-addon-s3',
473+
[ $this, 'renderS3Page' ]
474+
);
475+
}
476+
}

0 commit comments

Comments
 (0)