-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpavatar-wordpress.php.in
48 lines (37 loc) · 1009 Bytes
/
pavatar-wordpress.php.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/*
Plugin Name: Pavatar
Version: @VERSION@
Description: Displays a Pavatar avatar anywhere that get_avatar() is used (contact your theme's author if your theme lacks support).
Plugin URI: http://github.com/keithbowes/pavatar
*/
include '_pavatar.class.php';
$pavatar;
function _pavatar_wordpress_give_avatar()
{
global $comment, $pavatar;
if ($comment)
{
$pavatar->author_url = get_comment_author_url();
$pavatar->author_email = get_comment_author_email();
}
else
{
$pavatar->author_url = get_the_author_url();
$pavatar->author_email = get_the_author_email();
}
return $pavatar;
}
function _pavatar_wordpress_init()
{
global $_pavatar, $wp_version;
$pavatar = new Pavatar();
$pavatar->base_offset = get_option('siteurl');
$pavatar->user_agent['name'] = 'WordPress';
$pavatar->user_agent['version'] = $wp_version;
$pavatar->use_gravatar = true;
}
add_action('init', '_pavatar_wordpress_init');
add_filter('get_avatar', '_pavatar_wordpress_give_avatar');
// vim: noet
?>