-
Notifications
You must be signed in to change notification settings - Fork 1
/
post-thumbnail-extras.php
executable file
·53 lines (45 loc) · 1.24 KB
/
post-thumbnail-extras.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
<?php
/*
Plugin name: Post Thumbnail Extras
Plugin URI: https://github.com/sewpafly/post-thumbnail-extras
Author: sewpafly
Author URI: http://sewpafly.github.io/post-thumbnail-editor/
Version: 6.0
Description: Little things that make using post thumbnails easier
*/
/*
* Useful constants
*/
define( 'PTX_DOMAIN', 'post-thumbnail-extras' );
define( 'PTX_PLUGINURL', plugins_url(basename( dirname(__FILE__))) . "/");
class PostThumbnailExtras {
public function __construct() {
// Wordpress hooks and settings
add_action( 'init', array( $this, 'i18n' ) );
/*
* Load sub-objects
*/
$this->load_requires();
}
/**
* Internationalization and Localization
*/
public function i18n() {
$locale = apply_filters( 'plugin_locale', get_locale(), PTX_DOMAIN );
load_textdomain( PTX_DOMAIN
, WP_LANG_DIR.'/'.PTX_DOMAIN.'/'.PTX_DOMAIN.'-'.$locale.'.mo' );
load_plugin_textdomain( PTX_DOMAIN
, FALSE
, dirname( plugin_basename( __FILE__ ) ) . '/i18n/' );
}
private $requires = array( 'php/shortcode.php'
, 'php/options.php'
);
private function load_requires() {
$path = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;
foreach ( $this->requires as $require ){
require( $path . $require );
}
}
}
$ptx = new PostThumbnailExtras();