Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix not redirecting to Give welcome page on activations #2650 #2651

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion includes/admin/upgrades/class-give-updates.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,17 +228,32 @@ function __change_donations_label() {
}
}

/**
* Set the activation Redirect variable on Plugin activation for first time.
*
* @since 2.0
*
* @param bool $works ajax is Work in sites or not.
*/
public function give_reset_activation_redirect( $works ) {
// Add the transient to redirect.
Give_Cache::set( '_give_activation_redirect', true, 30, true );
}

/**
* Register updates menu
*
* @since 1.8.12
* @access public
*/
public function __register_menu() {

// Bailout.
if( ! give_test_ajax_works() ) {
add_action( 'give_test_ajax_works', array( $this, 'give_reset_activation_redirect' ) );
if ( ! give_test_ajax_works() ) {
return;
}
remove_action( 'give_test_ajax_works', array( $this, 'give_reset_activation_redirect' ) );

// Load plugin updates.
$this->__register_plugin_addon_updates();
Expand Down
9 changes: 9 additions & 0 deletions includes/ajax-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ function give_test_ajax_works() {
Give_Cache::set( '_give_ajax_works', '1', DAY_IN_SECONDS, true );
}

/**
* Fire just before return the value if ajax work or not.
*
* @since 2.0
*
* @param bool $works Ajax is working or not in sites.
*/
do_action( 'give_test_ajax_works', $works );

return $works;
}

Expand Down