Making WordPress.org


Ignore:
Timestamp:
02/02/2022 12:59:54 AM (3 years ago)
Author:
dd32
Message:

Trac: Restore the Trac favicon icon, instead of using the WordPress.org icon.

This makes it easier for Contributors to find their Trac tabs.

Fixes #6072.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/trac.wordpress.org/templates/update-headers.php

    r11465 r11499  
    11<?php
     2
     3// Avoid PHP Warnings from 'unexpected' tag attributes.
     4libxml_use_internal_errors( true );
    25
    36function domdocument_from_url( $url ) {
     
    7982    $html_node->appendChild( $wporg_head->importNode( $node, true ) );
    8083}
     84
     85// Swap out the shortcut icon for a Trac one. #6072
     86$icon_url = 'https://s.w.org/style/trac/common/trac.ico';
     87foreach ( ( new DOMXPath( $wporg_head ) )->query( '//link[@rel="icon"]' ) as $icon ) {
     88    $hash = md5( file_get_contents( $icon_url ) );
     89    $icon->setAttribute( 'href', $icon_url . '?v=' . $hash );
     90}
     91
    8192save_domdocument( __DIR__ . '/wporg-head.html', $wporg_head );
    8293
Note: See TracChangeset for help on using the changeset viewer.