Changeset 8607
- Timestamp:
- 04/08/2019 08:28:06 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions.php
r8606 r8607 84 84 add_action( 'init', 'wporg_login_register_scripts' ); 85 85 86 /** 87 * Output the GoogleTagManager <head> tags. 88 */ 86 89 function wporg_login_gtm() { 87 90 ?> … … 97 100 add_action( 'wp_head', 'wporg_login_gtm' ); 98 101 add_action( 'login_head', 'wporg_login_gtm' ); 102 103 /** 104 * wp_die() handler for login.wordpress.org, adds GTM to error pages. 105 */ 106 function wporg_login_die_handler( $message, $title = '', $args = array() ) { 107 ob_start(); 108 wporg_login_gtm(); 109 $gtm = ob_get_clean(); 110 111 $message = $gtm . $message; 112 return _default_wp_die_handler( $message, $title, $args ); 113 } 114 115 /** 116 * Switch the default WP_Die handler for login.wordpress.org to one that includes GTM. 117 */ 118 function wp_die_handler_switcher( $handler ) { 119 if ( $handler == '_default_wp_die_handler' ) { 120 $handler = 'wporg_login_die_handler'; 121 } 122 123 return $handler; 124 } 125 add_filter( 'wp_die_handler', 'wp_die_handler_switcher' ); 99 126 100 127 /**
Note: See TracChangeset
for help on using the changeset viewer.