-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathword-filter.php
64 lines (51 loc) · 1.29 KB
/
word-filter.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
61
62
63
64
<?php
/**
* Plugin Name: Word Filter
* Description: Filter your post word exclude from the content
* version: 1.0
* Author: Shakil Hossain
* Author URI: https://www.shakilhossain.com
* Text Domain: word-filter
* Domain Path: /languages
*/
use Inc\init;
if ( ! defined( 'ABSPATH' ) ) {
die( 'Invalid request.' );
}
require_once 'vendor/autoload.php';
define('PLUGIN_PATH', plugin_dir_path(__FILE__));
if (! class_exists('WordFilter')) :
class WordFilter
{
public function __construct()
{
add_action('init', [__CLASS__, 'languages']);
register_activation_hook(__FILE__, [__CLASS__, 'activate']);
register_deactivation_hook(__FILE__, [__CLASS__, 'deactivate']);
register_uninstall_hook(__FILE__, [__CLASS__, 'unstall']);
}
public function activate()
{
flush_rewrite_rules();
}
public function deactivate()
{
flush_rewrite_rules();
}
public function unstall()
{
// Do whatever You want
}
public function run()
{
$init = new init;
$init->register_services();
}
public function languages()
{
load_plugin_textdomain('word-filter', false, dirname(plugin_basename(__FILE__)) . '/languages');
}
}
endif;
$wordFilter = new WordFilter();
$wordFilter->run();