File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212 * @since 1.0.0
1313 */
1414function sqlite_plugin_activation_redirect () {
15- wp_safe_redirect ( admin_url ( 'admin.php?page=sqlite-integration ' ) );
15+ wp_redirect ( admin_url ( 'options-general.php?page=sqlite-integration ' ) );
16+ exit ;
1617}
17- register_activation_hook ( __FILE__ , 'sqlite_plugin_activation_redirect ' );
18+ // register_activation_hook( SQLITE_MAIN_FILE , 'sqlite_plugin_activation_redirect' );
1819
1920/**
2021 * Check the URL to ensure we're on the plugin page,
@@ -27,7 +28,7 @@ function sqlite_plugin_activation_redirect() {
2728 */
2829function sqlite_activation () {
2930 global $ current_screen ;
30- if ( isset ( $ current_screen ->base ) && 'toplevel_page_sqlite -integration ' === $ current_screen ->base ) {
31+ if ( isset ( $ current_screen ->base ) && 'settings_page_sqlite -integration ' === $ current_screen ->base ) {
3132 return ;
3233 }
3334 if ( isset ( $ _GET ['confirm-install ' ] ) && wp_verify_nonce ( $ _GET ['_wpnonce ' ], 'sqlite-install ' ) ) {
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ function sqlite_plugin_admin_notice() {
1515
1616 // Don't print notices in the plugin's admin screen.
1717 global $ current_screen ;
18- if ( isset ( $ current_screen ->base ) && 'toplevel_page_sqlite -integration ' === $ current_screen ->base ) {
18+ if ( isset ( $ current_screen ->base ) && 'settings_page_sqlite -integration ' === $ current_screen ->base ) {
1919 return ;
2020 }
2121
Original file line number Diff line number Diff line change 1313 * @since 1.0.0
1414 */
1515function sqlite_add_dummy_admin_menu () {
16- add_menu_page (
16+ add_options_page (
1717 __ ( 'SQLite integration ' , 'sqlite ' ),
1818 __ ( 'SQLite integration ' , 'sqlite ' ),
1919 'manage_options ' ,
2020 'sqlite-integration ' ,
2121 'sqlite_integration_pre_install_check_screen ' ,
22- '' ,
23- 3
2422 );
2523
2624}
2725add_action ( 'admin_menu ' , 'sqlite_add_dummy_admin_menu ' );
2826
29- /**
30- * Remove the admin menu, leaving the page itself.
31- *
32- * @since 1.0.0
33- */
34- function sqlite_remove_dummy_admin_menu () {
35- remove_menu_page ( 'sqlite-integration ' );
36- }
37- add_action ( 'admin_init ' , 'sqlite_remove_dummy_admin_menu ' );
38-
3927/**
4028 * The admin page contents.
4129 */
Original file line number Diff line number Diff line change 1313
1414define ( 'SQLITE_MAIN_FILE ' , __FILE__ );
1515
16+ require_once __DIR__ . '/admin-page.php ' ;
1617require_once __DIR__ . '/activate.php ' ;
1718require_once __DIR__ . '/deactivate.php ' ;
18- require_once __DIR__ . '/admin-page.php ' ;
1919require_once __DIR__ . '/admin-notices.php ' ;
2020require_once __DIR__ . '/health-check.php ' ;
You can’t perform that action at this time.
0 commit comments