w3tc_redirect

w3tc_redirect

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action
See hook in action

See hook in core

Displaying hooks found in version: w3-total-cache.2.8.2

do_action('w3tc_redirect') is found 2 times:

  • /Util_Environment.php line 1234
    	 */
    	public static function redirect( $url = '', $params = array() ) {
    		$url = self::url_format( $url, $params );
    		if ( function_exists( 'do_action' ) ) {
    			do_action( 'w3tc_redirect' );
    		}
    
    		@header( 'Location: ' . $url ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
    		exit();
    	}
    
    
  • /Util_Environment.php line 1256
    	public static function safe_redirect_temp( $url = '', $params = array(), $safe_redirect = false ) {
    		$url = self::url_format( $url, $params );
    
    		if ( function_exists( 'do_action' ) ) {
    			do_action( 'w3tc_redirect' );
    		}
    
    		$status_code = 302;
    
    		$protocol = isset( $_SERVER['SERVER_PROTOCOL'] ) ?
    			htmlspecialchars( stripslashes( $_SERVER['SERVER_PROTOCOL'] ) ) : ''; // phpcs:ignore
    

See this hook used in plugins: