• Hi.
    I’m trying to override the template generate for the action ‘tml_display_activate’

    I can’t get remove_action(‘tml_display_activate’,’tml_display_activate’) working…

    My custom template function is doubled with the original TML template output.

    Can you please help me ?
    thank you

Viewing 5 replies - 1 through 5 (of 5 total)
  • Try: remove_action('tml_display_activate','tml_display_activate', 11)

    In your example you are using the wrong quotes.

    Plugin Author Jeff Farthing

    (@jfarthing84)

    Nothing is displayed for the activate action. It is simply a redirect after handling the activation request…

    Thread Starter Colir

    (@colir)

    (@portbox) i use the right quotes
    remove_action(‘tml_display_activate’,’tml_display_activate’)
    it’s just due to not embed my code in code tag.

    (@jfarthing84) i’m n ot sure to well understand what you mean.

    I want to modifie the DOM & text when viewing the activation page (after clicking to an activate link received by email)

    
    	echo '<div class="login" id="theme-my-login' . esc_attr( $template->get_option( 'instance' ) ) . '">';
    
    	if ( empty( $_GET['key'] ) && empty( $_POST['key'] ) ) { ?>
    
    		<h2><?php _e( 'Activation Key Required', 'theme-my-login' ) ?></h2>
    		<form name="activateform" id="activateform" method="post" action="<?php $template->the_action_url( 'activate' ); ?>" class="c-form">
    			<div class="c-form__field">
    				<input type="text" name="key<?php $template->the_instance(); ?>" id="key" value="" size="50" />
    				<label for="key<?php $template->the_instance(); ?>"><?php _e( 'Activation Key:', 'theme-my-login' ) ?></label>
    
    			</div>
    			<div class="c-form__field -submit" class="submit">
    				<input id="submit<?php $template->the_instance(); ?>" type="submit" name="Submit" class="submit" value="<?php esc_attr_e( 'Activate', 'theme-my-login' ) ?>" />
    			</pdiv
    		></form>
    
    	<?php } else {
    
    		$key = ! empty( $_GET['key'] ) ? $_GET['key'] : $_POST['key'];
    		$result = wpmu_activate_signup( $key );
    		if ( is_wp_error( $result ) ) {
    			if ( 'already_active' == $result->get_error_code() || 'blog_taken' == $result->get_error_code() ) {
    				$signup = $result->get_error_data();
    				?>
    				<h2><?php _e( 'tml_user_account_activated', 'brandscenter' ); ?></h2>
    				<?php
    				echo '<p class="lead-in">';
    				if ( $signup->domain . $signup->path == '' ) {
    					printf( __( 'Your account has been activated. You may now <a href="%1$s">login</a> to the site using your chosen username of “%2$s”.  Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%4$s">reset your password</a>.', 'theme-my-login' ), network_site_url( 'wp-login.php', 'login' ), $signup->user_login, $signup->user_email, network_site_url( 'wp-login.php?action=lostpassword', 'login' ) );
    				} else {
    					printf( __( 'Your site at <a href="%1$s">%2$s</a> is active. You may now log in to your site using your chosen username of “%3$s”.  Please check your email inbox at %4$s for your password and login instructions.  If you do not receive an email, please check your junk or spam folder.  If you still do not receive an email within an hour, you can <a href="%5$s">reset your password</a>.', 'theme-my-login' ), 'https://' . $signup->domain, $signup->domain, $signup->user_login, $signup->user_email, network_site_url( 'wp-login.php?action=lostpassword' ) );
    				}
    				echo '</p>';
    			} else {
    				?>
    				<h2><?php _e( 'An error occurred during the activation', 'theme-my-login' ); ?></h2>
    				<?php
    				echo '<p>' . $result->get_error_message() . '</p>';
    			}
    		} else {
    			extract( $result );
    			$url = get_blogaddress_by_id( (int) $blog_id );
    			$user = new WP_User( (int) $user_id );
    			?>
    			<h2><?php _e( 'tml_user_account_activated', 'brandscenter' ); ?></h2>
    
    			<div id="signup-welcome">
    				<p><span class="h3"><?php _e( 'Username:', 'theme-my-login' ); ?></span> <?php echo $user->user_login ?></p>
    				<p><span class="h3"><?php _e( 'Password:', 'theme-my-login' ); ?></span> <?php echo $password; ?></p>
    			</div>
    
    			<?php if ( $url != network_home_url( '', 'http' ) ) : switch_to_blog( (int) $blog_id ); ?>
    				<p class="view"><?php printf( __( 'Your account is now activated. <a href="%1$s">View your site</a> or <a href="%2$s">Login</a>', 'theme-my-login' ), $url, wp_login_url() ); ?></p>
    			<?php restore_current_blog(); else: ?>
    				<p class="view"><?php printf( __( 'Your account is now activated. <a href="%1$s">Login</a> or go back to the <a href="%2$s">homepage</a>.', 'theme-my-login' ), network_site_url( 'wp-login.php', 'login' ), network_home_url() ); ?></p>
    			<?php endif;
    		}
    	}
    	echo '</div>';
    

    Thank you

    Plugin Author Jeff Farthing

    (@jfarthing84)

    There’s no easy way to do so.

    Thread Starter Colir

    (@colir)

    …a next feature perhaps..
    thanks you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Custom template for tml_display_activate’ is closed to new replies.