Skip to content

Commit d698b29

Browse files
committed
fix redirection on plugin activation
1 parent 09d7605 commit d698b29

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

activate.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,16 @@
1010
* Redirect to the plugin's admin screen on activation.
1111
*
1212
* @since 1.0.0
13+
*
14+
* @param string $plugin The plugin basename.
1315
*/
14-
function sqlite_plugin_activation_redirect() {
15-
wp_redirect( admin_url( 'options-general.php?page=sqlite-integration' ) );
16-
exit;
16+
function sqlite_plugin_activation_redirect( $plugin ) {
17+
if ( plugin_basename( SQLITE_MAIN_FILE ) === $plugin ) {
18+
wp_redirect( admin_url( 'options-general.php?page=sqlite-integration' ) );
19+
exit;
20+
}
1721
}
18-
// register_activation_hook( SQLITE_MAIN_FILE, 'sqlite_plugin_activation_redirect' );
22+
add_action( 'activated_plugin', 'sqlite_plugin_activation_redirect' );
1923

2024
/**
2125
* Check the URL to ensure we're on the plugin page,

0 commit comments

Comments
 (0)