Skip to content

fix adding cleanup to the $_GET query string so that activation/deactivation is not called again #2

@fotobank

Description

@fotobank

// fix adding cleanup to the $_GET query string so that activation/deactivation is not called again
public function admin_init(): bool {

 ...

    if( is_multisite() ) {
        activate_plugin( $plugin_file, null, true );
        add_action( 'network_admin_notices', fn() => $this->add_notice() );
    }
    else {
        activate_plugin( $plugin_file );
        add_action( 'admin_notices', fn() => $this->add_notice() );
    }

    // Add AlexJury: clearing the query string
    wp_redirect( remove_query_arg( array( 'plugin_file', '_wpnonce', 'action' ), wp_unslash( $_SERVER['REQUEST_URI']
    ) ) );
    exit;
 //   return true;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions