-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsharee.php
50 lines (45 loc) · 1.11 KB
/
sharee.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
<?php
/**
* Plugin Name: Sharēe
* Plugin URI: https://github.com/hametuha/sharee
* Description: User reward manager for WordPress
* Version: nightly
* Author: Hametuha INC.
* Author URI: https://hametuha.co.jp
* License: GPLv3 or later
* License URI: http://www.gnu.org/licenses/old-licenses/gpl-3.0.html
* Text Domain: sharee
* Domain Path: /languages
*/
// This file actually do nothing.
if ( ! defined( 'ABSPATH' ) ) {
die( 'Invalid request.' );
}
// Load autoloader.
require __DIR__ . '/vendor/autoload.php';
\Hametuha\Sharee::get_instance();
// Enable payment list.
add_filter( 'sharee_should_enable', function( $enabled, $service ) {
switch ( $service ) {
case 'billing':
return true;
default:
return $enabled;
}
}, 10, 2 );
// If hashboard exists, enable it.
add_action( 'plugins_loaded', function() {
if ( class_exists( 'Hametuha\\Hashboard' ) ) {
Hametuha\Hashboard::get_instance();
define( 'HASHBOARD', Hametuha\Hashboard::version() );
}
} );
/**
* Add labels.
*/
add_filter( 'sharee_labels', function( ) {
return [
'writing' => 'Writing',
'other' => 'Other',
];
} );