forked from 10up/simple-local-avatars
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimple-local-avatars.php
37 lines (32 loc) · 1.12 KB
/
simple-local-avatars.php
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
<?php
/**
* Plugin Name: Simple Local Avatars
* Plugin URI: http://10up.com/plugins/simple-local-avatars-wordpress/
* Description: Adds an avatar upload field to user profiles. Generates requested sizes on demand, just like Gravatar!
* Version: 2.0
* Author: Jake Goldman, 10up
* Author URI: http://10up.com
* License: GPLv2 or later
*
* @package Simple_Local_Avatars
* @author 10up
*/
require_once dirname( __FILE__ ) . '/includes/class-simple-local-avatars.php';
require_once dirname( __FILE__ ) . '/includes/template-tags.php';
$simple_local_avatars = new Simple_Local_Avatars;
/**
* Upon installation, remove settings and local avatars from WordPress.
*/
function simple_local_avatars_uninstall() {
$instance = new Simple_Local_Avatars;
$users = get_users( array(
'meta_key' => 'simple_local_avatar',
'fields' => 'ids',
) );
foreach ( $users as $user_id ) {
$instance->avatar_delete( $user_id );
}
// Remove settings from the database.
delete_option( 'simple_local_avatars' );
}
register_uninstall_hook( __FILE__, 'simple_local_avatars_uninstall' );