• In the function tml_action_handler() inside includes/actions.php, a dynamic action name in the form of
    'login_form_' . tml_get_request_value( 'action' ) is being called. However, when accessing an TML page, this action parameter doesn’t seem to be set, so the hook is always called simply login_form_.

    This is our current workaround:

    
    /**
     * fix TML's dynamic action hook 'login_form_*'
     */
    add_action( 'login_init', 'vad_tml_fix_action_parameter', 10, 0 );
    function vad_tml_fix_action_parameter() {
    	if ( empty( tml_get_request_value( 'action' ) ) ) {
    		$current_action = tml_get_action();
    		if ( $current_action ) {
    			$_REQUEST[ 'action' ] = $current_action->get_name();
    		}
    	}
    }
    
    • This topic was modified 2 years, 8 months ago by 48DESIGN.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jeff Farthing

    (@jfarthing84)

    Perhaps your server isn’t configured to populate $_REQUEST?

    Thread Starter 48DESIGN

    (@48design)

    Hi!

    No, that’s not the issue, the $_REQUEST variable contains other properties, just not the action at the time the action is being called!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Dynamic action hook in tml_action_handler() always has the same name’ is closed to new replies.