Admin.php
9 years ago
FlushRules.php
9 years ago
GetArchives.php
9 years ago
Option.php
9 years ago
Permalink.php
9 years ago
Rewrite.php
9 years ago
Setting.php
9 years ago
Setting.php
47 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | /** |
| 5 | * |
| 6 | * For load plugin. |
| 7 | * |
| 8 | * @package Custom_Post_Type_Permalinks |
| 9 | * @since 0.9.4 |
| 10 | * */ |
| 11 | |
| 12 | |
| 13 | class CPTP_Module_Setting extends CPTP_Module { |
| 14 | |
| 15 | public function add_hook() { |
| 16 | add_action( 'init', array( $this, 'load_textdomain' ) ); |
| 17 | add_action( 'plugins_loaded', array( $this, 'check_version' ) ); |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * |
| 22 | * check_version |
| 23 | * |
| 24 | * @since 0.8.6 |
| 25 | */ |
| 26 | |
| 27 | public function check_version() { |
| 28 | $version = get_option( 'cptp_version', 0 ); |
| 29 | if ( false === $version ) { |
| 30 | add_option( 'cptp_version', CPTP_VERSION ); |
| 31 | } else if ( CPTP_VERSION != $version ) { |
| 32 | update_option( 'cptp_version', CPTP_VERSION ); |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | |
| 37 | /** |
| 38 | * |
| 39 | * load textdomain |
| 40 | * |
| 41 | * @since 0.6.2 |
| 42 | */ |
| 43 | public function load_textdomain() { |
| 44 | load_plugin_textdomain( 'custom-post-type-permalinks', false, 'custom-post-type-permalinks/language' ); |
| 45 | } |
| 46 | } |
| 47 |