AnsPress_Avatar_Hook::clear_avatar_cache()
Description #
Ajax callback for clearing avatar cache.
Source #
File: addons/free/avatar.php
public static function clear_avatar_cache() {
check_ajax_referer( 'clear_avatar_cache', '__nonce' );
if ( current_user_can( 'manage_options' ) ) {
WP_Filesystem();
global $wp_filesystem;
$upload_dir = wp_upload_dir();
$wp_filesystem->rmdir( $upload_dir['basedir'] . '/ap_avatars', true );
wp_die( 'success' );
}
wp_die('failed');
}
Expand full source code Collapse full source code View on GitHub: addons/free/avatar.php:147
Add your comment