Ticket #42036: 42036.3.diff
File 42036.3.diff, 1.5 KB (added by , 6 years ago) |
---|
-
wp-admin/includes/admin-filters.php
38 38 add_filter( 'media_upload_tabs', 'update_gallery_tab' ); 39 39 40 40 // Misc hooks. 41 add_action( 'admin_init', 'wp_admin_headers' ); 42 add_action( 'login_init', 'wp_admin_headers' ); 41 43 add_action( 'admin_head', 'wp_admin_canonical_url' ); 42 44 add_action( 'admin_head', 'wp_color_scheme_settings' ); 43 45 add_action( 'admin_head', 'wp_site_icon' ); -
wp-admin/includes/misc.php
920 920 } 921 921 922 922 /** 923 * Send a referrer policy header so referrers are not sent for WP admin pages. 924 * 925 * @since 4.9 926 */ 927 function wp_admin_headers() { 928 $policy = 'same-origin'; 929 930 /** 931 * Filters the admin referrer policy 932 * 933 * @since 4.9 934 * 935 * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy 936 * 937 * @param string $policy The referrer policy setting. 938 */ 939 $policy = apply_filters( 'admin_referrer_policy', $policy ); 940 941 header( sprintf( 'Referrer-Policy: %s', $policy ) ); 942 } 943 944 /** 923 945 * Outputs JS that reloads the page if the user navigated to it with the Back or Forward button. 924 946 * 925 947 * Used on the Edit Post and Add New Post screens. Needed to ensure the page is not loaded from browser cache,