-
Notifications
You must be signed in to change notification settings - Fork 0
/
wp-graphql-gravatar.php
60 lines (54 loc) · 1.56 KB
/
wp-graphql-gravatar.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
/**
* WPGraphQL Gravatar
*
* Plugin definition.
*
* @package WP_GraphQL_Gravatar
* @link https://github.com/ArmandPhilippot/wp-graphql-gravatar
* @author Armand Philippot <contact@armandphilippot.com>
*
* @copyright 2021 Armand Philippot
* @license GPL-2.0-or-later
* @since 0.1.0
*
* @wordpress-plugin
* Plugin Name: WP GraphQL Gravatar
* Plugin URI: https://github.com/ArmandPhilippot/wp-graphql-gravatar#readme
* Description: This plugin adds a WP GraphQL field containing the Gravatar url of the comment author.
* Author: Armand Philippot
* Author URI: https://www.armandphilippot.com
* Text Domain: wpg-gravatar
* Domain Path: /languages
* Version: 1.1.1
* Requires at least: 5.2
* Requires PHP: 7.3
*/
namespace WP_GraphQL_Gravatar;
// If this file is called directly, abort.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/*
* Currently plugin version.
*/
define( 'WP_GRAPHQL_GRAVATAR_VERSION', '1.1.1' );
/**
* The code that runs during plugin activation.
*/
function activate_wp_graphql_gravatar() {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-wp-graphql-gravatar.php';
WP_GraphQL_Gravatar::activate();
}
register_activation_hook( __FILE__, 'WP_GraphQL_Gravatar\activate_wp_graphql_gravatar' );
/**
* Initialize the plugin.
*
* @since 0.1.0
*/
function wp_graphql_gravatar_init() {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-wp-graphql-gravatar.php';
$plugin = new WP_GRAPHQL_GRAVATAR();
$plugin->run();
}
wp_graphql_gravatar_init();