custom-post-type-permalinks
Last commit date
CPTP
10 years ago
language
10 years ago
.svnignore
10 years ago
CPTP.php
10 years ago
custom-post-type-permalinks.php
10 years ago
license.txt
12 years ago
readme.md
10 years ago
readme.txt
10 years ago
screenshot-1.png
14 years ago
custom-post-type-permalinks.php
59 lines
| 1 | <?php |
| 2 | /* |
| 3 | Plugin Name: Custom Post Type Permalinks |
| 4 | Plugin URI: http://www.torounit.com |
| 5 | Description: Add post archives of custom post type and customizable permalinks. |
| 6 | Author: Toro_Unit |
| 7 | Author URI: http://www.torounit.com/plugins/custom-post-type-permalinks/ |
| 8 | Version: 1.3.0 |
| 9 | Text Domain: cptp |
| 10 | License: GPL2 or later |
| 11 | Domain Path: /language/ |
| 12 | */ |
| 13 | |
| 14 | |
| 15 | /** |
| 16 | * |
| 17 | * Custom Post Type Permalinks |
| 18 | * |
| 19 | * @package Custom_Post_Type_Permalinks |
| 20 | * @version 1.3.0 |
| 21 | * |
| 22 | */ |
| 23 | |
| 24 | define( 'CPTP_PLUGIN_FILE', __FILE__ ); |
| 25 | $data = get_file_data( __FILE__, array( 'ver' => 'Version', 'lang_dir' => 'Domain Path' ) ); |
| 26 | define( 'CPTP_VERSION', $data['ver'] ); |
| 27 | define( 'CPTP_DEFAULT_PERMALINK', '/%postname%/' ); |
| 28 | |
| 29 | |
| 30 | |
| 31 | /** |
| 32 | * |
| 33 | * Autoloader for CPTP. |
| 34 | * @since 1.0.0 |
| 35 | * |
| 36 | */ |
| 37 | function cptp_class_loader( $class_name ) { |
| 38 | $dir = dirname( __FILE__ ); |
| 39 | $file_name = $dir . '/'. str_replace( '_', '/', $class_name ).'.php'; |
| 40 | if ( is_readable( $file_name ) ) { |
| 41 | include $file_name; |
| 42 | } |
| 43 | } |
| 44 | spl_autoload_register( 'cptp_class_loader' ); |
| 45 | |
| 46 | |
| 47 | /** |
| 48 | * |
| 49 | * Entry Point |
| 50 | * @since 0.9.4 |
| 51 | * |
| 52 | */ |
| 53 | add_action( 'plugins_loaded', 'cptp_init_instance' ); |
| 54 | function cptp_init_instance() { |
| 55 | CPTP::get_instance(); |
| 56 | } |
| 57 | |
| 58 | |
| 59 |