-
Notifications
You must be signed in to change notification settings - Fork 0
/
webp-rocket.php
70 lines (61 loc) · 1.53 KB
/
webp-rocket.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
65
66
67
68
69
70
<?php
/**
* Plugin Name: WebP Rocket
*
* Author: Yaroslav Yachmenov
*
* Author URI: https://www.linkedin.com/in/yaroslav-yachmenov-797945121/
*
* Description: Adds support of WebP images, operations over WebP images (rotation, slicing and others) on the image page and more.
*
* Version: 1.0
*
* Text Domain: webp-rocket
*
* Domain Path: /languages
*
* License: GPL v3
*/
defined( 'ABSPATH' ) || exit;
/**
* Current plugin version
*/
define( 'WEBP_ROCKET_PLUGIN_VERSION', '1.0' );
/**
* Path to the plugin
*/
define( 'WEBP_ROCKET_PATH', plugin_dir_path( __FILE__ ) );
/**
* Path to the plugin PHP files
*/
define( 'WEBP_ROCKET_PHP', WEBP_ROCKET_PATH . 'includes' );
/**
* URL to the plugin
*/
define( 'WEBP_ROCKET_URL', plugin_dir_url( __FILE__ ) );
/**
* URL to the assets of plugin
*/
define( 'WEBP_ROCKET_ASSETS_URL', WEBP_ROCKET_URL . 'assets' );
/**
* Plugin basename
*/
define( 'WEBP_ROCKET_BASENAME', plugin_basename( __FILE__ ) );
add_action( 'plugins_loaded', 'webp_rocket_load_plugin_textdomain' );
/**
* Loads textdomain for WebP Rocket plugin
*/
function webp_rocket_load_plugin_textdomain() {
load_plugin_textdomain( 'webp-rocket', false, WEBP_ROCKET_BASENAME . '/languages' );
}
add_action( 'init', 'webp_rocket_plugin_init' );
/**
* Entry point of WebP Rocket plugin
*/
function webp_rocket_plugin_init() {
require_once WEBP_ROCKET_PHP . '/general.php';
add_action( 'admin_init', 'webp_rocket_admin_plugin_init' );
function webp_rocket_admin_plugin_init() {
require_once WEBP_ROCKET_PHP . '/admin.php';
}
}