Roots Discourse

Override Gravity Forms User Registration activate.php

Wondering if anybody has already move the activate.php file to a Sage theme. This file was used by User Registration add-on for Gravity Forms and, according this tutorial, can be override.

What I try until now:

add_action( 'wp', function() {
	$is_activate_page = isset($_GET['gfur_activation']);

	if ( ! $is_activate_page ) {
		return;
	}

    template('gfur-activate-template.activate');
   exit();
}, 9);

But the screen becomes blank.

What version of Sage are you using?

@benword Using version 9.0.10

This is working better:

add_action('wp', function() {
	$is_activate_page = isset($_GET['gfur_activation']);
	if (!$is_activate_page) {
		return;
	}

    echo template('activate');
	exit();
}, 9);

But it cannot access methods from Controller/App.php. e.g:

PHP Notice: Undefined variable: get_header

I found another solution:

  1. Remove the action that include the template:

    add_action(‘init’, function () {
    $object = \GF_User_Registration::get_instance();
    remove_action(‘wp’, [$object, ‘maybe_activate_user’]);
    }, 20);

  2. Implement the template features in the theme, using this repo as a base.