bueltge/WordPress-Multisite-Enhancements — pull request #12 by JoryHogeveen (2014-10-23 10:39:44+00:00)
Title: Update class-add-admin-favicon.php

Extended version of the custom favicon filter.

Example filter function for plugin or theme (this is for a CobaltApps Dynamik theme):

add_filter( 'multisite_enhancements_favicon_path', 'fb_favicon_path', 10, 3 );
function fb_favicon_path($default, $id, $path_type) {
$path = '';
switch ($path_type) {
case 'dir':
$path = $_SERVER['DOCUMENT_ROOT'].'/';
break;
case 'url':
default:
$path = network_home_url();
break;
}

if (get_blog_option($id, 'stylesheet') == 'dynamik-gen') {
return $path.'wp-content/uploads/sites/'.$id.'/dynamik-gen/theme/images/favicon.png';
} else {
return $default;
}
}