Custom Post Type Permalinks - Version 0.9.5

Version Description

  • Big change plugin architecture.
  • Show has_archive, with_front.
Download this release

Release Info

Developer Toro_Unit
Plugin Icon 128x128 Custom Post Type Permalinks
Version 0.9.5
Comparing to
See all releases

Code changes from version 0.9.3.3 to 0.9.5

CPTP.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * CPTP
5
+ *
6
+ * Facade.
7
+ *
8
+ * @package Custom_Post_Type_Permalinks
9
+ * @since 0.9.4
10
+ *
11
+ * */
12
+
13
+
14
+ define( "CPTP_VERSION", "0.9.3" );
15
+ define( "CPTP_DEFAULT_PERMALINK", "/%postname%/" );
16
+ define( "CPTP_DIR", dirname( __FILE__ ) );
17
+
18
+
19
+ require_once CPTP_DIR.'/CPTP/Util.php';
20
+ require_once CPTP_DIR.'/CPTP/Module.php';
21
+ require_once CPTP_DIR.'/CPTP/Module/Setting.php';
22
+ require_once CPTP_DIR.'/CPTP/Module/Rewrite.php';
23
+ require_once CPTP_DIR.'/CPTP/Module/Admin.php';
24
+ require_once CPTP_DIR.'/CPTP/Module/Permalink.php';
25
+ require_once CPTP_DIR.'/CPTP/Module/GetArchives.php';
26
+ require_once CPTP_DIR.'/CPTP/Module/FlushRules.php';
27
+
28
+
29
+ class CPTP {
30
+
31
+ private static $instance;
32
+
33
+ private function __construct() {
34
+ $this->load_modules();
35
+ $this->init();
36
+ }
37
+
38
+ /**
39
+ *
40
+ * load_modules
41
+ *
42
+ * Load CPTP_Modules.
43
+ * @since 0.9.5
44
+ *
45
+ * */
46
+
47
+ private function load_modules() {
48
+ new CPTP_Module_Setting();
49
+ new CPTP_Module_Rewrite();
50
+ new CPTP_Module_Admin();
51
+ new CPTP_Module_Permalink();
52
+ new CPTP_Module_GetArchives();
53
+ new CPTP_Module_FlushRules();
54
+ do_action( "CPTP_load_modules" );
55
+
56
+ }
57
+
58
+ /**
59
+ *
60
+ * init
61
+ *
62
+ * Fire Module::add_hook
63
+ *
64
+ * @since 0.9.5
65
+ *
66
+ * */
67
+
68
+ private function init() {
69
+ do_action( "CPTP_init" );
70
+ }
71
+
72
+ /**
73
+ * Singleton
74
+ * @static
75
+ */
76
+ public static function get_instance() {
77
+
78
+ if (!isset(self::$_instance)) {
79
+ self::$instance = new CPTP;
80
+ }
81
+
82
+ return self::$instance;
83
+ }
84
+
85
+
86
+
87
+ }
CPTP/Module.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ Abstract Class CPTP_Module {
5
+
6
+ public function __construct() {
7
+ add_action("CPTP_init", array( $this, "add_hook" ));
8
+ }
9
+
10
+ abstract function add_hook();
11
+
12
+ }
CPTP/Module/Admin.php ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+
5
+ /**
6
+ *
7
+ * Admin Page.
8
+ *
9
+ * @package Custom_Post_Type_Permalinks
10
+ * @since 0.9.4
11
+ *
12
+ * */
13
+
14
+ class CPTP_Module_Admin extends CPTP_Module {
15
+
16
+ public function add_hook() {
17
+ add_action( 'admin_init', array( $this,'settings_api_init'), 30 );
18
+ add_action( 'admin_enqueue_scripts', array( $this,'enqueue_css_js') );
19
+ add_action( 'admin_footer', array( $this,'pointer_js') );
20
+ }
21
+
22
+ /**
23
+ *
24
+ * Setting Init
25
+ * @since 0.7
26
+ *
27
+ */
28
+ public function settings_api_init() {
29
+ add_settings_section('cptp_setting_section',
30
+ __("Permalink Setting for custom post type",'cptp'),
31
+ array( $this,'setting_section_callback_function'),
32
+ 'permalink'
33
+ );
34
+
35
+ $post_types = CPTP_Util::get_post_types();
36
+ foreach ($post_types as $post_type):
37
+ if(isset($_POST['submit']) and isset($_POST['_wp_http_referer'])){
38
+ if( strpos($_POST['_wp_http_referer'],'options-permalink.php') !== FALSE ) {
39
+
40
+ $structure = trim(esc_attr($_POST[$post_type.'_structure']));#get setting
41
+
42
+ #default permalink structure
43
+ if( !$structure )
44
+ $structure = CPTP_DEFAULT_PERMALINK;
45
+
46
+ $structure = str_replace('//','/','/'.$structure);# first "/"
47
+
48
+ #last "/"
49
+ $lastString = substr(trim(esc_attr($_POST['permalink_structure'])),-1);
50
+ $structure = rtrim($structure,'/');
51
+
52
+ if ( $lastString == '/')
53
+ $structure = $structure.'/';
54
+
55
+ update_option($post_type.'_structure', $structure );
56
+ }
57
+ }
58
+
59
+ add_settings_field($post_type.'_structure',
60
+ $post_type,
61
+ array( $this,'setting_structure_callback_function'),
62
+ 'permalink',
63
+ 'cptp_setting_section',
64
+ $post_type.'_structure'
65
+ );
66
+
67
+ register_setting('permalink',$post_type.'_structure');
68
+ endforeach;
69
+
70
+ add_settings_field(
71
+ 'no_taxonomy_structure',
72
+ __("Use custom permalink of custom taxonomy archive.",'cptp'),
73
+ array( $this,'setting_no_tax_structure_callback_function'),
74
+ 'permalink',
75
+ 'cptp_setting_section'
76
+ );
77
+
78
+ register_setting('permalink','no_taxonomy_structure');
79
+
80
+ if(isset($_POST['submit']) && isset($_POST['_wp_http_referer']) && strpos($_POST['_wp_http_referer'],'options-permalink.php') !== false ) {
81
+
82
+ if(!isset($_POST['no_taxonomy_structure'])){
83
+ $set = true;
84
+ }else {
85
+ $set = false;
86
+ }
87
+ update_option('no_taxonomy_structure', $set);
88
+ }
89
+ }
90
+
91
+ public function setting_section_callback_function() {
92
+ ?>
93
+ <p><?php _e("Setting permalinks of custom post type.",'cptp');?><br />
94
+ <?php _e("The tags you can use is WordPress Structure Tags and '%\"custom_taxonomy_slug\"%'. (e.g. %actors%)",'cptp');?><br />
95
+ <?php _e("%\"custom_taxonomy_slug\"% is replaced the taxonomy's term.'.",'cptp');?></p>
96
+
97
+ <p><?php _e("Presence of the trailing '/' is unified into a standard permalink structure setting.",'cptp');?>
98
+ <p><?php _e("If <code>has_archive</code> is true, add permalinks for custom post type archive.",'cptp');?>
99
+ <?php _e("If you don't entered permalink structure, permalink is configured /%postname%/'.",'cptp');?>
100
+ </p>
101
+ <?php
102
+ }
103
+
104
+ public function setting_structure_callback_function( $option ) {
105
+ $post_type = str_replace('_structure',"" ,$option);
106
+ $slug = get_post_type_object($post_type)->rewrite['slug'];
107
+ $with_front = get_post_type_object($post_type)->rewrite['with_front'];
108
+
109
+ $value = get_option($option);
110
+ if( !$value )
111
+ $value = CPTP_DEFAULT_PERMALINK;
112
+
113
+ global $wp_rewrite;
114
+ $front = substr( $wp_rewrite->front, 1 );
115
+ if( $front and $with_front ) {
116
+ $slug = $front.$slug;
117
+ }
118
+
119
+ echo '<p><code>'.home_url().'/'.$slug.'</code> <input name="'.$option.'" id="'.$option.'" type="text" class="regular-text code" value="' . $value .'" /></p>';
120
+ echo '<p>has_archive: <code>';
121
+ echo get_post_type_object($post_type)->has_archive ? "true" : "false";
122
+ echo '</code> / ';
123
+ echo 'with_front: <code>';
124
+ echo get_post_type_object($post_type)->with_front ? "true" : "false";
125
+ echo '</code></p>';
126
+
127
+ }
128
+
129
+ public function setting_no_tax_structure_callback_function(){
130
+ echo '<input name="no_taxonomy_structure" id="no_taxonomy_structure" type="checkbox" value="1" class="code" ' . checked( false, get_option('no_taxonomy_structure'),false) . ' /> ';
131
+ $txt = __("If you check,The custom taxonomy's permalinks is <code>%s/post_type/taxonomy/term</code>.","cptp");
132
+ printf($txt , home_url());
133
+ }
134
+
135
+
136
+
137
+ /**
138
+ *
139
+ * enqueue CSS and JS
140
+ * @since 0.8.5
141
+ *
142
+ */
143
+ public function enqueue_css_js() {
144
+ wp_enqueue_style('wp-pointer');
145
+ wp_enqueue_script('wp-pointer');
146
+ }
147
+
148
+
149
+
150
+ /**
151
+ *
152
+ * add js for pointer
153
+ * @since 0.8.5
154
+ */
155
+ public function pointer_js() {
156
+ if(!is_network_admin()) {
157
+ $dismissed = explode(',', get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ));
158
+ if(array_search('cptp_pointer0871', $dismissed) === false){
159
+ $content = __("<h3>Custom Post Type Permalinks</h3><p>From <a href='options-permalink.php'>Permalinks</a>, set a custom permalink for each post type.</p>", "cptp");
160
+ ?>
161
+ <script type="text/javascript">
162
+ jQuery(function($) {
163
+
164
+ $("#menu-settings .wp-has-submenu").pointer({
165
+ content: "<?php echo $content;?>",
166
+ position: {"edge":"left","align":"center"},
167
+ close: function() {
168
+ $.post('admin-ajax.php', {
169
+ action:'dismiss-wp-pointer',
170
+ pointer: 'cptp_pointer0871'
171
+ })
172
+
173
+ }
174
+ }).pointer("open");
175
+ });
176
+ </script>
177
+ <?php
178
+ }
179
+ }
180
+ }
181
+ }
182
+
CPTP/Module/FlushRules.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * Reflush Rewrite Rules
6
+ *
7
+ * @package Custom_Post_Type_Permalinks
8
+ * @since 0.9.4
9
+ *
10
+ * */
11
+
12
+ class CPTP_Module_FlushRules extends CPTP_Module {
13
+
14
+
15
+ public function add_hook() {
16
+ add_action( 'init', array( $this, 'update_rules') );
17
+ add_action( 'update_option_cptp_version', array( $this, 'update_rules') );
18
+ add_action( 'wp_loaded', array( $this, "dequeue_flush_rules"),100);
19
+ }
20
+
21
+ /**
22
+ *
23
+ * dequeue flush rules
24
+ * @since 0.9
25
+ *
26
+ */
27
+
28
+ public function dequeue_flush_rules () {
29
+ if(get_option("queue_flush_rules")){
30
+ flush_rewrite_rules();
31
+ update_option( "queue_flush_rules", 0 );
32
+
33
+ }
34
+ }
35
+
36
+
37
+ /**
38
+ *
39
+ * Add hook flush_rules
40
+ * @since 0.7.9
41
+ *
42
+ */
43
+ public function update_rules() {
44
+
45
+ $post_types = CPTP_Util::get_post_types();
46
+ $type_count = count($post_types);
47
+ $i = 0;
48
+ foreach ($post_types as $post_type):
49
+ add_action('update_option_'.$post_type.'_structure',array( $this,'queue_flush_rules'),10,2);
50
+ endforeach;
51
+ add_action('update_option_no_taxonomy_structure',array( $this,'queue_flush_rules'),10,2);
52
+ }
53
+
54
+
55
+
56
+ /**
57
+ * Flush rules
58
+ *
59
+ * @since 0.7.9
60
+ *
61
+ */
62
+
63
+ public function queue_flush_rules(){
64
+ update_option( "queue_flush_rules", 1 );
65
+ }
66
+
67
+ }
CPTP/Module/GetArchives.php ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ /**
5
+ *
6
+ * wp_get_archive hooks.
7
+ *
8
+ * @package Custom_Post_Type_Permalinks
9
+ * @since 0.9.4
10
+ *
11
+ * */
12
+
13
+ class CPTP_Module_GetArchives extends CPTP_Module {
14
+
15
+ public function add_hook() {
16
+ if(get_option( "permalink_structure") != "") {
17
+ add_filter( 'getarchives_join', array( $this,'getarchives_join'), 10, 2 ); // [steve]
18
+ add_filter( 'getarchives_where', array( $this,'getarchives_where'), 10 , 2 );
19
+ add_filter( 'get_archives_link', array( $this,'get_archives_link'), 20, 1 );
20
+ }
21
+
22
+ }
23
+
24
+ /**
25
+ *
26
+ * wp_get_archives fix for custom post
27
+ * Ex:wp_get_archives('&post_type='.get_query_var( 'post_type' ));
28
+ * @version 2.0
29
+ *
30
+ */
31
+
32
+ public $get_archives_where_r;
33
+
34
+ // function modified by [steve]
35
+ public function getarchives_where( $where, $r ) {
36
+ $this->get_archives_where_r = $r;
37
+ if ( isset($r['post_type']) ) {
38
+ $where = str_replace( '\'post\'', '\'' . $r['post_type'] . '\'', $where );
39
+ }
40
+
41
+ if(isset($r['taxonomy']) && is_array($r['taxonomy']) ){
42
+ global $wpdb;
43
+ $where = $where . " AND $wpdb->term_taxonomy.taxonomy = '".$r['taxonomy']['name']."' AND $wpdb->term_taxonomy.term_id = '".$r['taxonomy']['termid']."'";
44
+ }
45
+
46
+ return $where;
47
+ }
48
+
49
+
50
+
51
+ //function added by [steve]
52
+ /**
53
+ *
54
+ * get_archive_join
55
+ * @author Steve
56
+ * @since 0.8
57
+ * @version 1.0
58
+ *
59
+ *
60
+ */
61
+ public function getarchives_join( $join, $r ) {
62
+ global $wpdb;
63
+ $this->get_archives_where_r = $r;
64
+ if(isset($r['taxonomy']) && is_array($r['taxonomy']) )
65
+ $join = $join . " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)";
66
+
67
+ return $join;
68
+ }
69
+
70
+
71
+
72
+ /**
73
+ *
74
+ * get_arcihves_link
75
+ * @version 2.1
76
+ *
77
+ */
78
+ public function get_archives_link( $link ) {
79
+ if(!isset($this->get_archives_where_r['post_type'])) {
80
+ return $link;
81
+ }
82
+ $c = isset($this->get_archives_where_r['taxonomy']) && is_array($this->get_archives_where_r['taxonomy']) ? $this->get_archives_where_r['taxonomy'] : ""; //[steve]
83
+ $t = $this->get_archives_where_r['post_type'];
84
+
85
+
86
+ $this->get_archives_where_r['post_type'] = isset($this->get_archives_where_r['post_type_slug']) ? $this->get_archives_where_r['post_type_slug'] : $t; // [steve] [*** bug fixing]
87
+
88
+ if (isset($this->get_archives_where_r['post_type']) and $this->get_archives_where_r['type'] != 'postbypost'){
89
+ $blog_url = rtrim( get_bloginfo("url") ,'/');
90
+
91
+ //remove .ext
92
+ $str = preg_replace("/\.[a-z,_]*/","",get_option("permalink_structure"));
93
+
94
+ if($str = rtrim( preg_replace("/%[a-z,_]*%/","",$str) ,'/')) { // /archive/%post_id%
95
+ $ret_link = str_replace($str, '/'.'%link_dir%', $link);
96
+ }else{
97
+ $blog_url = preg_replace('/https?:\/\//', '', $blog_url);
98
+ $ret_link = str_replace($blog_url,$blog_url.'/'.'%link_dir%',$link);
99
+ }
100
+
101
+ $post_type = get_post_type_object( $this->get_archives_where_r['post_type'] );
102
+ if(empty($c) ){ // [steve]
103
+ if(isset( $post_type->rewrite["slug"] )) {
104
+ $link_dir = $post_type->rewrite["slug"];
105
+ }
106
+ else{
107
+ $link_dir = $this->get_archives_where_r['post_type'];
108
+ }
109
+ }
110
+ else{ // [steve]
111
+ $c['name'] = ($c['name'] == 'category' && get_option('category_base')) ? get_option('category_base') : $c['name'];
112
+ $link_dir = $post_type->rewrite["slug"]."/".$c['name']."/".$c['termslug'];
113
+ }
114
+
115
+ if(!strstr($link,'/date/')){
116
+ $link_dir = $link_dir .'/date';
117
+ }
118
+
119
+ if($post_type->rewrite['with_front']) {
120
+ global $wp_rewrite;
121
+ $link_dir = substr( $wp_rewrite->front, 1 ).$link_dir;
122
+ }
123
+
124
+
125
+ $ret_link = str_replace('%link_dir%',$link_dir,$ret_link);
126
+ }else {
127
+ $ret_link = $link;
128
+ }
129
+ $this->get_archives_where_r['post_type'] = $t; // [steve] reverting post_type to previous value
130
+
131
+ return $ret_link;
132
+ }
133
+
134
+ }
CPTP/Module/Permalink.php ADDED
@@ -0,0 +1,246 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ /**
5
+ *
6
+ * CPTP_Permalink
7
+ *
8
+ * Override Permalinks
9
+ * @package Custom_Post_Type_Permalinks
10
+ * @since 0.9.4
11
+ *
12
+ * */
13
+
14
+
15
+ class CPTP_Module_Permalink extends CPTP_Module {
16
+
17
+
18
+ public function add_hook() {
19
+ if(get_option( "permalink_structure") != "") {
20
+ add_filter( 'post_type_link', array( $this,'post_type_link'), 10, 4 );
21
+ add_filter( 'term_link', array( $this,'term_link'), 10, 3 );
22
+ add_filter( 'attachment_link', array( $this, 'attachment_link'), 20 , 2);
23
+ }
24
+ }
25
+
26
+ /**
27
+ *
28
+ * Fix permalinks output.
29
+ *
30
+ * @param String $post_link
31
+ * @param Object $post 投稿情報
32
+ * @param String $leavename 記事編集画面でのみ渡される
33
+ *
34
+ * @version 2.0
35
+ *
36
+ */
37
+ public function post_type_link( $post_link, $post, $leavename ) {
38
+
39
+ global $wp_rewrite;
40
+
41
+ $draft_or_pending = isset( $post->post_status ) && in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft' ) );
42
+ if( $draft_or_pending and !$leavename )
43
+ return $post_link;
44
+
45
+
46
+
47
+ $post_type = $post->post_type;
48
+ $permalink = $wp_rewrite->get_extra_permastruct( $post_type );
49
+
50
+ $permalink = str_replace( '%post_id%', $post->ID, $permalink );
51
+ $permalink = str_replace( '%'.$post_type.'_slug%', get_post_type_object( $post_type )->rewrite['slug'], $permalink );
52
+
53
+
54
+
55
+ //親ページが有るとき。
56
+ $parentsDirs = "";
57
+ if( !$leavename ){
58
+ $postId = $post->ID;
59
+ while ($parent = get_post($postId)->post_parent) {
60
+ $parentsDirs = get_post($parent)->post_name."/".$parentsDirs;
61
+ $postId = $parent;
62
+ }
63
+ }
64
+
65
+ $permalink = str_replace( '%'.$post_type.'%', $parentsDirs.'%'.$post_type.'%', $permalink );
66
+
67
+ if( !$leavename ){
68
+ $permalink = str_replace( '%'.$post_type.'%', $post->post_name, $permalink );
69
+ }
70
+
71
+ //%post_id%/attachment/%attachement_name%;
72
+ //画像の編集ページでのリンク
73
+ if( isset($_GET["post"]) && $_GET["post"] != $post->ID ) {
74
+ $parent_structure = trim(get_option( $post->post_type.'_structure' ), "/");
75
+ if( "%post_id%" == $parent_structure or "%post_id%" == array_pop( explode( "/", $parent_structure ) ) ) {
76
+ $permalink = $permalink."/attachment/";
77
+ };
78
+ }
79
+
80
+ $search = array();
81
+ $replace = array();
82
+
83
+ $replace_tag = $this->create_taxonomy_replace_tag( $post->ID , $permalink );
84
+ $search = $search + $replace_tag["search"];
85
+ $replace = $replace + $replace_tag["replace"];
86
+
87
+
88
+ $user = get_userdata( $post->post_author );
89
+ if(isset($user->user_nicename)) {
90
+ $permalink = str_replace( "%author%", $user->user_nicename, $permalink );
91
+ }
92
+
93
+ $post_date = strtotime( $post->post_date );
94
+ $permalink = str_replace(array(
95
+ "%year%",
96
+ "%monthnum%",
97
+ "%day%",
98
+ "%hour%",
99
+ "%minute%",
100
+ "%second%"
101
+ ), array(
102
+ date("Y",$post_date),
103
+ date("m",$post_date),
104
+ date("d",$post_date),
105
+ date("H",$post_date),
106
+ date("i",$post_date),
107
+ date("s",$post_date)
108
+ ), $permalink );
109
+ $permalink = str_replace($search, $replace, $permalink);
110
+ $permalink = rtrim( home_url(),"/")."/".ltrim( $permalink ,"/" );
111
+
112
+ return $permalink;
113
+ }
114
+
115
+
116
+
117
+ /**
118
+ *
119
+ * create %tax% -> term
120
+ *
121
+ * */
122
+ private function create_taxonomy_replace_tag( $post_id , $permalink ) {
123
+ $search = array();
124
+ $replace = array();
125
+
126
+ $taxonomies = CPTP_Util::get_taxonomies( true );
127
+
128
+ //%taxnomomy% -> parent/child
129
+ //運用でケアすべきかも。
130
+
131
+ foreach ( $taxonomies as $taxonomy => $objects ) {
132
+ $term = null;
133
+ if ( strpos($permalink, "%$taxonomy%") !== false ) {
134
+ $terms = wp_get_post_terms( $post_id, $taxonomy, array('orderby' => 'term_id'));
135
+
136
+ if ( $terms and count($terms) > 1 ) {
137
+ if(reset($terms)->parent == 0){
138
+
139
+ $keys = array_keys($terms);
140
+ $term = $terms[$keys[1]]->slug;
141
+ if ( $terms[$keys[0]]->term_id == $terms[$keys[1]]->parent ) {
142
+ $term = CPTP_Util::get_taxonomy_parents( $terms[$keys[1]]->parent,$taxonomy, false, '/', true ) . $term;
143
+ }
144
+ }else{
145
+ $keys = array_keys($terms);
146
+ $term = $terms[$keys[0]]->slug;
147
+ if ( $terms[$keys[1]]->term_id == $terms[$keys[0]]->parent ) {
148
+ $term = CPTP_Util::get_taxonomy_parents( $terms[$keys[0]]->parent,$taxonomy, false, '/', true ) . $term;
149
+ }
150
+ }
151
+ }else if( $terms ){
152
+
153
+ $term_obj = array_shift($terms);
154
+ $term = $term_obj->slug;
155
+
156
+ if(isset($term_obj->parent) and $term_obj->parent != 0) {
157
+ $term = CPTP_Util::get_taxonomy_parents( $term_obj->parent,$taxonomy, false, '/', true ) . $term;
158
+ }
159
+ }
160
+
161
+ if( isset($term) ) {
162
+ $search[] = "%$taxonomy%";
163
+ $replace[] = $term;
164
+ }
165
+
166
+ }
167
+ }
168
+ return array("search" => $search, "replace" => $replace );
169
+ }
170
+
171
+
172
+
173
+ /**
174
+ *
175
+ * fix attachment output
176
+ *
177
+ * @version 1.0
178
+ * @since 0.8.2
179
+ *
180
+ */
181
+
182
+ public function attachment_link( $link , $postID ) {
183
+ $post = get_post( $postID );
184
+ if (!$post->post_parent){
185
+ return $link;
186
+ }
187
+ $post_parent = get_post( $post->post_parent );
188
+ $permalink = get_option( $post_parent->post_type.'_structure' );
189
+ $post_type = get_post_type_object( $post_parent->post_type );
190
+
191
+ if( $post_type->_builtin == false ) {
192
+ if(strpos( $permalink, "%postname%" ) < strrpos( $permalink, "%post_id%" ) && strrpos( $permalink, "attachment/" ) === FALSE ){
193
+ $link = str_replace($post->post_name , "attachment/".$post->post_name, $link);
194
+ }
195
+ }
196
+
197
+ return $link;
198
+ }
199
+
200
+ /**
201
+ *
202
+ * Fix taxonomy link outputs.
203
+ * @since 0.6
204
+ * @version 1.0
205
+ *
206
+ */
207
+ public function term_link( $termlink, $term, $taxonomy ) {
208
+ if( get_option('no_taxonomy_structure') ) {
209
+ return $termlink;
210
+ }
211
+
212
+ $taxonomy = get_taxonomy($taxonomy);
213
+ if( $taxonomy->_builtin )
214
+ return $termlink;
215
+
216
+ if( empty($taxonomy) )
217
+ return $termlink;
218
+
219
+ $wp_home = rtrim( home_url(), '/' );
220
+
221
+ $post_type = $taxonomy->object_type[0];
222
+ $post_type_obj = get_post_type_object($post_type);
223
+ $slug = $post_type_obj->rewrite['slug'];
224
+ $with_front = $post_type_obj->rewrite['with_front'];
225
+
226
+
227
+ //拡張子を削除。
228
+ $str = array_shift(explode(".", get_option("permalink_structure")));
229
+ $str = rtrim( preg_replace( "/%[a-z_]*%/", "" ,$str) ,'/' );//remove with front
230
+ $termlink = str_replace($str."/", "/", $termlink );
231
+
232
+
233
+ if( $with_front === false ) {
234
+ $str = "";
235
+ }
236
+ $slug = $str."/".$slug;
237
+
238
+ $termlink = str_replace( $wp_home, $wp_home.$slug, $termlink );
239
+ if ( ! $taxonomy->rewrite['hierarchical'] ) {
240
+ $termlink = str_replace( $term->slug.'/', CPTP_Util::get_taxonomy_parents( $term->term_id,$taxonomy->name, false, '/', true ), $termlink );
241
+ }
242
+
243
+ return $termlink;
244
+ }
245
+
246
+ }
CPTP/Module/Rewrite.php ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+
5
+ /**
6
+ *
7
+ * Add Rewrite Rules
8
+ *
9
+ * @package Custom_Post_Type_Permalinks
10
+ * @since 0.9.4
11
+ *
12
+ * */
13
+
14
+ class CPTP_Module_Rewrite extends CPTP_Module {
15
+
16
+ public function add_hook() {
17
+ add_action( 'parse_request', array( $this, "parse_request") );
18
+ add_action( 'wp_loaded', array( $this,'add_archive_rewrite_rules'), 99 );
19
+ add_action( 'wp_loaded', array( $this,'add_tax_rewrite_rules') );
20
+ add_action( 'registered_post_type', array( $this,'registered_post_type'), 10, 2 );
21
+ }
22
+
23
+ /**
24
+ *
25
+ * Add rewrite rules for archives.
26
+ * @version 1.1
27
+ *
28
+ */
29
+ public function add_archive_rewrite_rules() {
30
+ $post_types = CPTP_Util::get_post_types();
31
+
32
+ foreach ( $post_types as $post_type ):
33
+ if( !$post_type ) {
34
+ continue;
35
+ }
36
+
37
+ $permalink = get_option( $post_type.'_structure' );
38
+ $post_type_obj = get_post_type_object($post_type);
39
+ $slug = $post_type_obj->rewrite['slug'];
40
+ if( !$slug )
41
+ $slug = $post_type;
42
+
43
+ if( $post_type_obj->has_archive ){
44
+ if( is_string( $post_type_obj->has_archive ) ){
45
+ $slug = $post_type_obj->has_archive;
46
+ };
47
+
48
+ if($post_type_obj->rewrite['with_front']) {
49
+ global $wp_rewrite;
50
+ $slug = substr( $wp_rewrite->front, 1 ).$slug;
51
+ }
52
+
53
+
54
+ add_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]&post_type='.$post_type, 'top' );
55
+ add_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]&post_type='.$post_type, 'top' );
56
+ add_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&paged=$matches[4]&post_type='.$post_type, 'top' );
57
+ add_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&post_type='.$post_type, 'top' );
58
+ add_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]&post_type='.$post_type, 'top' );
59
+ add_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]&post_type='.$post_type, 'top' );
60
+ add_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&paged=$matches[3]&post_type='.$post_type, 'top' );
61
+ add_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&post_type='.$post_type, 'top' );
62
+ add_rewrite_rule( $slug.'/date/([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&feed=$matches[2]&post_type='.$post_type, 'top' );
63
+ add_rewrite_rule( $slug.'/date/([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&feed=$matches[2]&post_type='.$post_type, 'top' );
64
+ add_rewrite_rule( $slug.'/date/([0-9]{4})/page/?([0-9]{1,})/?$', 'index.php?year=$matches[1]&paged=$matches[2]&post_type='.$post_type, 'top' );
65
+ add_rewrite_rule( $slug.'/date/([0-9]{4})/?$', 'index.php?year=$matches[1]&post_type='.$post_type, 'top' );
66
+ add_rewrite_rule( $slug.'/author/([^/]+)/?$', 'index.php?author_name=$matches[1]&post_type='.$post_type, 'top' );
67
+ }
68
+
69
+ endforeach;
70
+ }
71
+
72
+
73
+
74
+ /**
75
+ *
76
+ * registered_post_type
77
+ * ** add rewrite tag for Custom Post Type.
78
+ * @version 1.1
79
+ * @since 0.9
80
+ *
81
+ */
82
+
83
+ public function registered_post_type( $post_type, $args ) {
84
+
85
+ global $wp_post_types, $wp_rewrite, $wp;
86
+
87
+ if( $args->_builtin or !$args->publicly_queryable or !$args->show_ui ){
88
+ return false;
89
+ }
90
+ $permalink = get_option( $post_type.'_structure' );
91
+
92
+ if( !$permalink ) {
93
+ $permalink = CPTP_DEFAULT_PERMALINK;
94
+ }
95
+
96
+ $permalink = '%'.$post_type.'_slug%'.$permalink;
97
+ $permalink = str_replace( '%postname%', '%'.$post_type.'%', $permalink );
98
+
99
+ add_rewrite_tag( '%'.$post_type.'_slug%', '('.$args->rewrite['slug'].')','post_type='.$post_type.'&slug=' );
100
+
101
+ $taxonomies = CPTP_Util::get_taxonomies( true );
102
+ foreach ( $taxonomies as $taxonomy => $objects ):
103
+ $wp_rewrite->add_rewrite_tag( "%$taxonomy%", '(.+?)', "$taxonomy=" );
104
+ endforeach;
105
+
106
+ $permalink = trim($permalink, "/" );
107
+ $rewrite_args = $args->rewrite;
108
+ $rewrite_args["walk_dirs"] = false;
109
+ add_permastruct( $post_type, $permalink, $rewrite_args);
110
+
111
+ }
112
+
113
+ /**
114
+ *
115
+ * Add rewrite rules for custom taxonomies.
116
+ * @since 0.6
117
+ * @version 2.1
118
+ *
119
+ */
120
+ public function add_tax_rewrite_rules() {
121
+ if(get_option('no_taxonomy_structure')) {
122
+ return false;
123
+ }
124
+
125
+
126
+ global $wp_rewrite;
127
+ $taxonomies = CPTP_Util::get_taxonomies();
128
+ $taxonomies['category'] = 'category';
129
+
130
+ if(empty($taxonomies)) {
131
+ return false;
132
+ }
133
+
134
+ foreach ($taxonomies as $taxonomy) :
135
+ $taxonomyObject = get_taxonomy($taxonomy);
136
+ $post_types = $taxonomyObject->object_type;
137
+
138
+ foreach ($post_types as $post_type):
139
+ $post_type_obj = get_post_type_object($post_type);
140
+ $slug = $post_type_obj->rewrite['slug'];
141
+
142
+
143
+ if(!$slug) {
144
+ $slug = $post_type;
145
+ }
146
+
147
+ if(is_string($post_type_obj->has_archive)) {
148
+ $slug = $post_type_obj->has_archive;
149
+ };
150
+
151
+ if($post_type_obj->rewrite['with_front']) {
152
+ $slug = substr( $wp_rewrite->front, 1 ).$slug;
153
+ }
154
+
155
+ if ( $taxonomy == 'category' ){
156
+ $taxonomypat = ($cb = get_option('category_base')) ? $cb : $taxonomy;
157
+ $tax = 'category_name';
158
+ } else {
159
+ // Edit by [Xiphe]
160
+ if (isset($taxonomyObject->rewrite['slug'])) {
161
+ $taxonomypat = $taxonomyObject->rewrite['slug'];
162
+ } else {
163
+ $taxonomypat = $taxonomy;
164
+ }
165
+ // [Xiphe] stop
166
+
167
+ $tax = $taxonomy;
168
+ }
169
+
170
+
171
+ //add taxonomy slug
172
+ add_rewrite_rule( $slug.'/'.$taxonomypat.'/(.+?)/page/?([0-9]{1,})/?$', 'index.php?'.$tax.'=$matches[1]&paged=$matches[2]&post_type='.$post_type, 'top' );
173
+ add_rewrite_rule( $slug.'/'.$taxonomypat.'/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$', 'index.php?'.$tax.'=$matches[1]&feed=$matches[2]&post_type='.$post_type, 'top' );
174
+ add_rewrite_rule( $slug.'/'.$taxonomypat.'/(.+?)/(feed|rdf|rss|rss2|atom)/?$', 'index.php?'.$tax.'=$matches[1]&feed=$matches[2]&post_type='.$post_type, 'top' );
175
+ add_rewrite_rule( $slug.'/'.$taxonomypat.'/(.+?)/?$', 'index.php?'.$tax.'=$matches[1]&post_type='.$post_type, 'top' ); // modified by [steve] [*** bug fixing]
176
+
177
+ // below rules were added by [steve]
178
+ add_rewrite_rule( $taxonomypat.'/(.+?)/date/([0-9]{4})/([0-9]{1,2})/?$', 'index.php?'.$tax.'=$matches[1]&year=$matches[2]&monthnum=$matches[3]&post_type='.$post_type, 'top' );
179
+ add_rewrite_rule( $taxonomypat.'/(.+?)/date/([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$', 'index.php?'.$tax.'=$matches[1]&year=$matches[2]&monthnum=$matches[3]&paged=$matches[4]&post_type='.$post_type, 'top' );
180
+ add_rewrite_rule( $slug.'/'.$taxonomypat.'/(.+?)/date/([0-9]{4})/([0-9]{1,2})/?$', 'index.php?'.$tax.'=$matches[1]&year=$matches[2]&monthnum=$matches[3]&post_type='.$post_type, 'top' );
181
+ add_rewrite_rule( $slug.'/'.$taxonomypat.'/(.+?)/date/([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$', 'index.php?'.$tax.'=$matches[1]&year=$matches[2]&monthnum=$matches[3]&paged=$matches[4]&post_type='.$post_type, 'top' );
182
+
183
+ endforeach;
184
+ endforeach;
185
+ }
186
+
187
+
188
+
189
+ /**
190
+ *
191
+ * Fix taxonomy = parent/child => taxonomy => child
192
+ * @since 0.9.3
193
+ *
194
+ */
195
+ public function parse_request($obj) {
196
+ $taxes = CPTP_Util::get_taxonomies();
197
+ foreach ($taxes as $key => $tax) {
198
+ if(isset($obj->query_vars[$tax])) {
199
+ if(strpos( $obj->query_vars[$tax] ,"/") !== false ) {
200
+ $obj->query_vars[$tax] = array_pop(explode("/", $obj->query_vars[$tax]));
201
+ }
202
+ }
203
+ }
204
+ }
205
+ }
CPTP/Module/Setting.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
14
+ class CPTP_Module_Setting extends CPTP_Module {
15
+
16
+ public function add_hook() {
17
+ add_action( 'init', array( $this,'load_textdomain') );
18
+ add_action( 'plugins_loaded', array( $this,'check_version') );
19
+ }
20
+
21
+ /**
22
+ *
23
+ * check_version
24
+ * @since 0.8.6
25
+ *
26
+ */
27
+
28
+ public function check_version() {
29
+ $version = get_option('cptp_version', 0);
30
+ if($version != CPTP_VERSION) {
31
+ update_option('cptp_version', CPTP_VERSION);
32
+ }
33
+ }
34
+
35
+
36
+ /**
37
+ *
38
+ * load textdomain
39
+ * @since 0.6.2
40
+ *
41
+ */
42
+ public function load_textdomain() {
43
+ load_plugin_textdomain('cptp',false,'custom-post-type-permalinks/language');
44
+ }
45
+
46
+ }
CPTP/Util.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * Utilty Class
6
+ *
7
+ * @package Custom_Post_Type_Permalinks
8
+ * @since 0.9.4
9
+ *
10
+ * */
11
+
12
+ class CPTP_Util {
13
+
14
+ private function __construct() {
15
+ }
16
+
17
+ public static function get_post_types() {
18
+ return get_post_types( array('_builtin'=>false, 'publicly_queryable'=>true, 'show_ui' => true) );
19
+ }
20
+
21
+ public static function get_taxonomies( $objects = false ) {
22
+ if( $objects ){
23
+ $output = "objects";
24
+ }
25
+ else {
26
+ $output = "names";
27
+ }
28
+ return get_taxonomies( array("show_ui" => true, "_builtin" => false), $output );
29
+ }
30
+
31
+
32
+ /**
33
+ *
34
+ * Get Custom Taxonomies parents.
35
+ * @version 1.0
36
+ *
37
+ */
38
+ public static function get_taxonomy_parents( $id, $taxonomy = 'category', $link = false, $separator = '/', $nicename = false, $visited = array() ) {
39
+ $chain = '';
40
+ $parent = get_term( $id, $taxonomy );
41
+ if ( is_wp_error( $parent ) ) {
42
+ return $parent;
43
+ }
44
+
45
+ if ( $nicename ){
46
+ $name = $parent->slug;
47
+ }else {
48
+ $name = $parent->name;
49
+ }
50
+
51
+ if ( $parent->parent && ( $parent->parent != $parent->term_id ) && !in_array( $parent->parent, $visited ) ) {
52
+ $visited[] = $parent->parent;
53
+ $chain .= CPTP_Util::get_taxonomy_parents( $parent->parent, $taxonomy, $link, $separator, $nicename, $visited );
54
+ }
55
+
56
+ if ( $link ) {
57
+ $chain .= '<a href="' . get_term_link( $parent->term_id, $taxonomy ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $parent->name ) ) . '">'.$name.'</a>' . $separator;
58
+ }else {
59
+ $chain .= $name.$separator;
60
+ }
61
+ return $chain;
62
+ }
63
+
64
+
65
+
66
+ }
cptp.sublime-project ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "folders":
3
+ [
4
+ {
5
+ "follow_symlinks": true,
6
+ "path": "."
7
+ }
8
+ ]
9
+ }
cptp.sublime-workspace ADDED
@@ -0,0 +1,2410 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "auto_complete":
3
+ {
4
+ "selected_items":
5
+ [
6
+ [
7
+ "CPT",
8
+ "CPTP_Module_GetArchives (class)"
9
+ ],
10
+ [
11
+ "CPTP",
12
+ "CPTP_Module_Permalink (class)"
13
+ ],
14
+ [
15
+ "border-co",
16
+ "border-color"
17
+ ],
18
+ [
19
+ "register",
20
+ "register_sidebar register_sidebar All Options"
21
+ ],
22
+ [
23
+ "ctypr",
24
+ "ctype_graph"
25
+ ],
26
+ [
27
+ "ctype",
28
+ "comment_type"
29
+ ],
30
+ [
31
+ "cpt",
32
+ "ctype_print"
33
+ ],
34
+ [
35
+ "register_po",
36
+ "register_post_type Register Post Type All Options"
37
+ ],
38
+ [
39
+ "imp",
40
+ "import (rule)"
41
+ ],
42
+ [
43
+ "cl",
44
+ "class= (attribute)"
45
+ ],
46
+ [
47
+ "blo",
48
+ "bloginfo"
49
+ ],
50
+ [
51
+ "body",
52
+ "body_class"
53
+ ],
54
+ [
55
+ "the_ti",
56
+ "the_title (function)"
57
+ ],
58
+ [
59
+ "style",
60
+ "stylesheet_directory"
61
+ ],
62
+ [
63
+ "blog",
64
+ "bloginfo"
65
+ ],
66
+ [
67
+ "loop_",
68
+ "blog_option_"
69
+ ],
70
+ [
71
+ "loo",
72
+ "apache_lookup_uri"
73
+ ],
74
+ [
75
+ "loop",
76
+ "loop_start"
77
+ ],
78
+ [
79
+ "h",
80
+ "height"
81
+ ],
82
+ [
83
+ "webkit-col",
84
+ "-webkit-column-rule: (property)"
85
+ ],
86
+ [
87
+ "we",
88
+ "-webkit-animation: (property)"
89
+ ],
90
+ [
91
+ "webkit-co",
92
+ "-webkit-column-width: (property)"
93
+ ],
94
+ [
95
+ "ap",
96
+ "apiConfig (variable)"
97
+ ],
98
+ [
99
+ "se",
100
+ "searchResponse"
101
+ ],
102
+ [
103
+ "fu",
104
+ "fun function …"
105
+ ],
106
+ [
107
+ "searh",
108
+ "searchResponse"
109
+ ],
110
+ [
111
+ "grid",
112
+ "grid-contents"
113
+ ],
114
+ [
115
+ "con",
116
+ "console"
117
+ ],
118
+ [
119
+ "de",
120
+ "default"
121
+ ],
122
+ [
123
+ "L",
124
+ "Log"
125
+ ],
126
+ [
127
+ "op",
128
+ "options"
129
+ ],
130
+ [
131
+ "get",
132
+ "getData"
133
+ ],
134
+ [
135
+ "sel",
136
+ "self"
137
+ ],
138
+ [
139
+ "in",
140
+ "inline-block"
141
+ ],
142
+ [
143
+ "fir",
144
+ "first-child"
145
+ ],
146
+ [
147
+ "Re",
148
+ "reloader"
149
+ ],
150
+ [
151
+ "delete_opti",
152
+ "delete_options"
153
+ ],
154
+ [
155
+ "PPPP_U",
156
+ "PPPP_Utility"
157
+ ],
158
+ [
159
+ "add_setting_",
160
+ "add_settings_section"
161
+ ],
162
+ [
163
+ "post",
164
+ "post_type"
165
+ ],
166
+ [
167
+ "get_post_ty",
168
+ "get_post_types"
169
+ ],
170
+ [
171
+ "posts_per",
172
+ "posts_per_page_by_"
173
+ ],
174
+ [
175
+ "add_setting",
176
+ "add_settings_field"
177
+ ],
178
+ [
179
+ "uninstall_",
180
+ "uninstall_hook"
181
+ ],
182
+ [
183
+ "for",
184
+ "foreach foreach …"
185
+ ],
186
+ [
187
+ "is_post_t",
188
+ "is_post_type_archive"
189
+ ],
190
+ [
191
+ "wp",
192
+ "wp_rewrite"
193
+ ],
194
+ [
195
+ "memo",
196
+ "Memos"
197
+ ],
198
+ [
199
+ "set",
200
+ "setMemory"
201
+ ],
202
+ [
203
+ "preg",
204
+ "preg_match"
205
+ ],
206
+ [
207
+ "hi",
208
+ "hidden"
209
+ ],
210
+ [
211
+ "font-s",
212
+ "font-style"
213
+ ],
214
+ [
215
+ "argin",
216
+ "margin-right"
217
+ ],
218
+ [
219
+ "margin",
220
+ "margin-left"
221
+ ],
222
+ [
223
+ "pa",
224
+ "padding"
225
+ ],
226
+ [
227
+ "po",
228
+ "pos-a position: absolute;"
229
+ ],
230
+ [
231
+ "ta",
232
+ "ta-c text-align: center;"
233
+ ],
234
+ [
235
+ "re",
236
+ "relative"
237
+ ],
238
+ [
239
+ "wid",
240
+ "width"
241
+ ],
242
+ [
243
+ "b",
244
+ "block"
245
+ ],
246
+ [
247
+ "wi",
248
+ "width"
249
+ ],
250
+ [
251
+ "mar",
252
+ "margin"
253
+ ],
254
+ [
255
+ "fo",
256
+ "font-size"
257
+ ],
258
+ [
259
+ "font",
260
+ "font-family"
261
+ ],
262
+ [
263
+ "wp_get_attache",
264
+ "wp_get_attachment_image_src"
265
+ ],
266
+ [
267
+ "err",
268
+ "error_reporting"
269
+ ],
270
+ [
271
+ "wp_get",
272
+ "wp_get_attachment_image"
273
+ ],
274
+ [
275
+ "pos",
276
+ "position"
277
+ ],
278
+ [
279
+ "r",
280
+ "relative"
281
+ ],
282
+ [
283
+ "tex",
284
+ "text-indent"
285
+ ],
286
+ [
287
+ "di",
288
+ "display"
289
+ ],
290
+ [
291
+ "a",
292
+ "attachments"
293
+ ],
294
+ [
295
+ "wp_get_att",
296
+ "wp_get_attachment_link"
297
+ ],
298
+ [
299
+ "html",
300
+ "htmlspecialchars"
301
+ ],
302
+ [
303
+ "is_a",
304
+ "is_array"
305
+ ],
306
+ [
307
+ "print",
308
+ "print_r"
309
+ ],
310
+ [
311
+ "pri",
312
+ "print_r"
313
+ ],
314
+ [
315
+ "par",
316
+ "parse"
317
+ ],
318
+ [
319
+ "he",
320
+ "hash (variable)"
321
+ ],
322
+ [
323
+ "mb",
324
+ "margin-bottom"
325
+ ],
326
+ [
327
+ "wp_reset",
328
+ "wp_reset_postdata"
329
+ ],
330
+ [
331
+ "bord",
332
+ "border-left"
333
+ ],
334
+ [
335
+ "swi",
336
+ "switch_to_blog"
337
+ ],
338
+ [
339
+ "class",
340
+ "classes"
341
+ ],
342
+ [
343
+ "fun",
344
+ "function"
345
+ ],
346
+ [
347
+ "arr",
348
+ "array"
349
+ ],
350
+ [
351
+ "add_f",
352
+ "add_filter"
353
+ ],
354
+ [
355
+ "add_fi",
356
+ "add_filter"
357
+ ],
358
+ [
359
+ "get_cate",
360
+ "get_category_link"
361
+ ],
362
+ [
363
+ "root",
364
+ "rootId"
365
+ ]
366
+ ]
367
+ },
368
+ "buffers":
369
+ [
370
+ {
371
+ "file": "custom-post-type-permalinks.php",
372
+ "settings":
373
+ {
374
+ "buffer_size": 516,
375
+ "line_ending": "Unix"
376
+ }
377
+ },
378
+ {
379
+ "file": "/Users/torounit/Desktop/jetpack/jetpack.php",
380
+ "settings":
381
+ {
382
+ "buffer_size": 4242,
383
+ "line_ending": "Unix"
384
+ }
385
+ },
386
+ {
387
+ "file": "CPTP/Module/Admin.php",
388
+ "settings":
389
+ {
390
+ "buffer_size": 5297,
391
+ "line_ending": "Unix"
392
+ }
393
+ },
394
+ {
395
+ "file": "language/cptp-ru_RU.po",
396
+ "settings":
397
+ {
398
+ "buffer_size": 3204,
399
+ "line_ending": "Unix"
400
+ }
401
+ },
402
+ {
403
+ "file": "language/cptp-ja.po",
404
+ "settings":
405
+ {
406
+ "buffer_size": 2549,
407
+ "line_ending": "Unix"
408
+ }
409
+ },
410
+ {
411
+ "file": "CPTP.php",
412
+ "settings":
413
+ {
414
+ "buffer_size": 1091,
415
+ "line_ending": "Unix"
416
+ }
417
+ },
418
+ {
419
+ "file": "CPTP/Util.php",
420
+ "settings":
421
+ {
422
+ "buffer_size": 1494,
423
+ "line_ending": "Unix"
424
+ }
425
+ },
426
+ {
427
+ "file": "CPTP/Module/Permalink.php",
428
+ "settings":
429
+ {
430
+ "buffer_size": 6301,
431
+ "line_ending": "Unix"
432
+ }
433
+ },
434
+ {
435
+ "file": "/Users/torounit/GitHub/cptp-test-vagrant/Vagrantfile",
436
+ "settings":
437
+ {
438
+ "buffer_size": 4312,
439
+ "line_ending": "Unix"
440
+ }
441
+ }
442
+ ],
443
+ "build_system": "",
444
+ "command_palette":
445
+ {
446
+ "height": 210.0,
447
+ "selected_items":
448
+ [
449
+ [
450
+ "ruby",
451
+ "Set Syntax: Ruby"
452
+ ],
453
+ [
454
+ "tab",
455
+ "Indentation: Convert to Tabs"
456
+ ],
457
+ [
458
+ "coffeesc",
459
+ "Set Syntax: CoffeeScript (Literate)"
460
+ ],
461
+ [
462
+ "htm",
463
+ "Set Syntax: HTML"
464
+ ],
465
+ [
466
+ "html",
467
+ "Set Syntax: HTML"
468
+ ],
469
+ [
470
+ "less",
471
+ "Set Syntax: LESS"
472
+ ],
473
+ [
474
+ "install",
475
+ "Package Control: Install Package"
476
+ ],
477
+ [
478
+ "nrw",
479
+ "File: New File Relative to Current View"
480
+ ],
481
+ [
482
+ "addo",
483
+ "Project: Add Folder"
484
+ ],
485
+ [
486
+ "indenti",
487
+ "Indentation: Convert to Spaces"
488
+ ],
489
+ [
490
+ "rename",
491
+ "File: Rename"
492
+ ],
493
+ [
494
+ "list",
495
+ "Package Control: List Packages"
496
+ ],
497
+ [
498
+ "remove",
499
+ "Package Control: Remove Package"
500
+ ],
501
+ [
502
+ "tidy",
503
+ "Tidy HTML"
504
+ ],
505
+ [
506
+ "shell",
507
+ "Set Syntax: Shell Script (Bash)"
508
+ ],
509
+ [
510
+ "inden",
511
+ "Indentation: Convert to Tabs"
512
+ ],
513
+ [
514
+ "new ",
515
+ "File: New File Relative to Current View"
516
+ ],
517
+ [
518
+ "new",
519
+ "File: New View into File"
520
+ ],
521
+ [
522
+ "folder",
523
+ "Project: Add Folder"
524
+ ],
525
+ [
526
+ "dele",
527
+ "File: Delete"
528
+ ],
529
+ [
530
+ "file",
531
+ "File: New File Relative to Current View"
532
+ ],
533
+ [
534
+ "move",
535
+ "File: Move"
536
+ ],
537
+ [
538
+ "indens",
539
+ "Indentation: Convert to Spaces"
540
+ ],
541
+ [
542
+ "close",
543
+ "File: Close All"
544
+ ],
545
+ [
546
+ "direc",
547
+ "Snippet: directory()"
548
+ ],
549
+ [
550
+ "css",
551
+ "Set Syntax: CSS"
552
+ ],
553
+ [
554
+ "coffee",
555
+ "Coffee: Toggle Watch Mode"
556
+ ],
557
+ [
558
+ "toggle",
559
+ "Coffee: Toggle Watch Mode"
560
+ ],
561
+ [
562
+ "toggle w",
563
+ "Coffee: Toggle Watch Mode"
564
+ ],
565
+ [
566
+ "di",
567
+ "Coffee: Display JavaScript"
568
+ ],
569
+ [
570
+ "dis",
571
+ "Coffee: Display JavaScript"
572
+ ],
573
+ [
574
+ "coffe",
575
+ "Coffee: Display JavaScript"
576
+ ],
577
+ [
578
+ "co",
579
+ "Coffee: Display JavaScript"
580
+ ],
581
+ [
582
+ "c",
583
+ "Package Control: Add Repository"
584
+ ],
585
+ [
586
+ "tid",
587
+ "Tidy PHP"
588
+ ],
589
+ [
590
+ "json",
591
+ "Set Syntax: JSON"
592
+ ],
593
+ [
594
+ "php",
595
+ "Set Syntax: PHP"
596
+ ],
597
+ [
598
+ "",
599
+ "About"
600
+ ],
601
+ [
602
+ "insta",
603
+ "Package Control: Install Package"
604
+ ],
605
+ [
606
+ "scss",
607
+ "Set Syntax: SCSS"
608
+ ],
609
+ [
610
+ "install ",
611
+ "Package Control: Install Package"
612
+ ],
613
+ [
614
+ "pack",
615
+ "Package Control: Install Package"
616
+ ]
617
+ ],
618
+ "width": 593.0
619
+ },
620
+ "console":
621
+ {
622
+ "height": 125.0,
623
+ "history":
624
+ [
625
+ "import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ','%20')).read())"
626
+ ]
627
+ },
628
+ "distraction_free":
629
+ {
630
+ "menu_visible": true,
631
+ "show_minimap": false,
632
+ "show_open_files": false,
633
+ "show_tabs": false,
634
+ "side_bar_visible": false,
635
+ "status_bar_visible": false
636
+ },
637
+ "file_history":
638
+ [
639
+ "/Users/torounit/GitHub/custom-post-type-permalinks/readme.txt",
640
+ "/Users/torounit/Desktop/jetpack/class.jetpack.php",
641
+ "/Users/torounit/GitHub/custom-post-type-permalinks/CPTP/Loader.php",
642
+ "/Users/torounit/GitHub/custom-post-type-permalinks/custom-post-type-permalinks.php",
643
+ "/Users/torounit/Sites/gridbook/sass/style.scss",
644
+ "/Users/torounit/Sites/gridbook/coffee/column.coffee",
645
+ "/Users/torounit/Dropbox/dev/lifegame.coffee",
646
+ "/Users/torounit/Sites/gridbook/css/sass/style.css",
647
+ "/Users/torounit/Sites/gridbook/config.rb",
648
+ "/Users/torounit/Sites/gridbook/coffee/column.js",
649
+ "/Users/torounit/Sites/gridbook/css/style.css",
650
+ "/Users/torounit/Desktop/profoundgrid-master/css/examples/fixed.css",
651
+ "/Users/torounit/Sites/gridbook/sass/examples/responsive.scss",
652
+ "/Users/torounit/Desktop/profoundgrid-master/sass/examples/fixed.scss",
653
+ "/Users/torounit/Desktop/profoundgrid-master/css/examples/responsive.css",
654
+ "/Users/torounit/Library/Application Support/Sublime Text 3/Packages/User/Preferences.sublime-settings",
655
+ "/Users/torounit/Sites/less/less/_normalize.less",
656
+ "/Users/torounit/Sites/less/sass/sass.scss",
657
+ "/Users/torounit/Library/Application Support/Sublime Text 3/Packages/Default/Preferences.sublime-settings",
658
+ "/private/var/folders/s4/2zp6bm8d7s9_s46_jyvrghfm0000gn/T/344eaae8-a689-4b00-9929-f0d72872fefe/.bash_profile",
659
+ "/private/var/folders/s4/2zp6bm8d7s9_s46_jyvrghfm0000gn/T/344eaae8-a689-4b00-9929-f0d72872fefe/.gitconfig",
660
+ "/private/var/folders/s4/2zp6bm8d7s9_s46_jyvrghfm0000gn/T/344eaae8-a689-4b00-9929-f0d72872fefe/web/torounit.com/www/.htaccess",
661
+ "/Users/torounit/Sites/bunko/Vagrantfile",
662
+ "/Users/torounit/Sites/www/bunko/index.html",
663
+ "/Users/torounit/Sites/bunko/www/wordpress/wp-content/themes/bunko/sass/_mixin.scss",
664
+ "/Users/torounit/Sites/www/bunko/style.css",
665
+ "/Users/torounit/Sites/bunko/www/wordpress/wp-content/themes/bunko/index.php",
666
+ "/Users/torounit/Sites/bunko/www/wordpress/wp-content/themes/bunko/stylesheets/style.css",
667
+ "/Users/torounit/Sites/bunko/www/wordpress/wp-content/themes/bunko/stylesheets/normalize.css",
668
+ "/Users/torounit/Sites/bunko/www/wordpress/wp-content/themes/bunko/style.css",
669
+ "/Users/torounit/Downloads/agunino_kami.txt",
670
+ "/Users/torounit/Sites/neko/config.php",
671
+ "/Users/torounit/Sites/neko/.gitignore",
672
+ "/private/var/folders/s4/2zp6bm8d7s9_s46_jyvrghfm0000gn/T/344eaae8-a689-4b00-9929-f0d72872fefe/web/torounit.com/www/wp-content/themes/twentythirteen/functions.php",
673
+ "/private/var/folders/s4/2zp6bm8d7s9_s46_jyvrghfm0000gn/T/344eaae8-a689-4b00-9929-f0d72872fefe/web/torounit.com/www/wp-content/themes/twentythirteen/css/editor-style.css",
674
+ "/Users/torounit/Downloads/wordpress 2/wp-includes/theme.php",
675
+ "/private/var/folders/s4/2zp6bm8d7s9_s46_jyvrghfm0000gn/T/344eaae8-a689-4b00-9929-f0d72872fefe/web/torounit.com/www/wp-content/themes/ToroUnit2013/functions.php",
676
+ "/private/var/folders/s4/2zp6bm8d7s9_s46_jyvrghfm0000gn/T/344eaae8-a689-4b00-9929-f0d72872fefe/web/torounit.com/www/wp-content/themes/ToroUnit2013/front-page.php",
677
+ "/private/var/folders/s4/2zp6bm8d7s9_s46_jyvrghfm0000gn/T/344eaae8-a689-4b00-9929-f0d72872fefe/web/torounit.com/www/wp-content/themes/ToroUnit2013/editor-style.css",
678
+ "/Users/torounit/Downloads/wordpress 2/wp-content/themes/twentythirteen/functions.php",
679
+ "/Users/torounit/Sites/neko/vendor/google/google-api-php-client/src/config.php",
680
+ "/Users/torounit/Sites/neko/vendor/google/google-api-php-client/src/local_config.php",
681
+ "/Users/torounit/Sites/neko/vendor/google/google-api-php-client/src/Google_Client.php",
682
+ "/Users/torounit/Sites/neko/vendor/google/google-api-php-client/src/cache/Google_FileCache.php",
683
+ "/Users/torounit/Library/Application Support/Sublime Text 2/Packages/User/Preferences.sublime-settings",
684
+ "/Users/torounit/Sites/neko/vendor/google/google-api-php-client/src/cache/Google_Cache.php",
685
+ "/Users/torounit/Sites/neko/composer.json",
686
+ "/private/var/folders/s4/2zp6bm8d7s9_s46_jyvrghfm0000gn/T/344eaae8-a689-4b00-9929-f0d72872fefe/web/torounit.com/www/wp-content/themes/ToroUnit2012/functions.php",
687
+ "/Users/torounit/Sites/neko/composer.lock",
688
+ "/usr/local/etc/php/5.4/php.ini",
689
+ "/Users/torounit/Sites/neko/vendor/composer/autoload_classmap.php",
690
+ "/Users/torounit/Sites/neko/index.php",
691
+ "/private/etc/apache2/httpd.conf",
692
+ "/Users/torounit/Sites/neko/.htaccess",
693
+ "/private/etc/apache2/users/torounit.conf",
694
+ "/etc/apache2/httpd.conf",
695
+ "/Users/torounit/Sites/www/vgrid/js/script.js",
696
+ "/Users/torounit/Sites/www/vgrid/js/jQuery.vgrid.min.js",
697
+ "/Users/torounit/Sites/www/vgrid/js/script.coffee",
698
+ "/Users/torounit/Sites/www/vgrid/css/app.scss",
699
+ "/Users/torounit/Sites/www/vgrid/index.html",
700
+ "/Users/torounit/Library/Application Support/Sublime Text 2/Packages/User/Default (OSX).sublime-keymap",
701
+ "/Users/torounit/Ruby/Sinatra/nekotube/config.ru",
702
+ "/Users/torounit/Ruby/Sinatra/nekotube/app.rb",
703
+ "/Users/torounit/Ruby/Sinatra/Todo/app.rb",
704
+ "/Users/torounit/Ruby/Rails/nekotube/app/controllers/youtubes_controller.rb",
705
+ "/Users/torounit/.bash_profile",
706
+ "/Users/torounit/Develop/ToroUnit2013/footer.php",
707
+ "/Users/torounit/Develop/ToroUnit2013/sass/_content.scss",
708
+ "/Users/torounit/Develop/ToroUnit2013/sass/style.scss",
709
+ "/Users/torounit/Develop/ToroUnit2013/loop.php",
710
+ "/Users/torounit/Develop/ToroUnit2013/config.rb",
711
+ "/Users/torounit/Develop/ToroUnit2013/single-portfolio.php",
712
+ "/Users/torounit/Develop/ToroUnit2013/sass/_container.scss",
713
+ "/Users/torounit/Library/Application Support/Sublime Text 2/Packages/User/SFTP.errors.log",
714
+ "/Users/torounit/Develop/ToroUnit2013/css/style.css",
715
+ "/Users/torounit/Develop/ToroUnit2013/codekit-config.json",
716
+ "/Users/torounit/Develop/ToroUnit2013/404.php",
717
+ "/Users/torounit/Develop/ToroUnit2013/header.php",
718
+ "/Users/torounit/Develop/ToroUnit2013/front-page.php",
719
+ "/Users/torounit/Develop/ToroUnit2013/sass/_comment.scss",
720
+ "/Users/torounit/Develop/ToroUnit2013/sass/_reset.scss",
721
+ "/Users/torounit/Develop/ToroUnit2013/index.php",
722
+ "/Users/torounit/Develop/ToroUnit2013/sftp-config.json",
723
+ "/Users/torounit/Develop/ToroUnit2013/sass/content.scss",
724
+ "/Users/torounit/Develop/ToroUnit2013/sass/style.css",
725
+ "/private/var/folders/s4/2zp6bm8d7s9_s46_jyvrghfm0000gn/T/344eaae8-a689-4b00-9929-f0d72872fefe/web/torounit.com/www/wp-content/themes/ToroUnit2012/style.css",
726
+ "/Users/torounit/Ruby/Sinatra/Hello/css/css.css",
727
+ "/Users/torounit/Ruby/Sinatra/Hello/css/style.css",
728
+ "/Users/torounit/Ruby/Sinatra/css/style.css",
729
+ "/Users/torounit/Ruby/Sinatra/css/css/style.css",
730
+ "/Users/torounit/Ruby/Sinatra/css/css/css/style.css",
731
+ "/Users/torounit/Library/Application Support/Sublime Text 2/Packages/Browser Refresh/Default (OSX).sublime-keymap",
732
+ "/Users/torounit/Library/Application Support/Sublime Text 2/Packages/LiveReload/LiveReload.sublime-settings",
733
+ "/Users/torounit/Ruby/Sinatra/Todo",
734
+ "/Users/torounit/Ruby/Sinatra/hello.rb",
735
+ "/Users/torounit/Ruby/Sinatra/Gemfile",
736
+ "/Users/torounit/GitHub/mogok/config.ru",
737
+ "/Users/torounit/Sites/vagrantpress/wordpress/wp-content/plugins/debug.php",
738
+ "/Users/torounit/GitHub/pppp/readme.txt",
739
+ "/Users/torounit/Sites/vagrantpress/wordpress/wp-config.php",
740
+ "/Users/torounit/ruby/Backbone-on-Rails-todoDemo/app/views/todos/create.html.erb",
741
+ "/Users/torounit/.bashrc",
742
+ "/Users/torounit/.zshrc",
743
+ "/private/var/folders/s4/2zp6bm8d7s9_s46_jyvrghfm0000gn/T/344eaae8-a689-4b00-9929-f0d72872fefe/web/torounit.com/test/wpbeta/wp-content/plugins/custom-post-type-permalinks/custom-post-type-permalinks.php",
744
+ "/Users/torounit/GitHub/pppp/pppp.php",
745
+ "/Users/torounit/Sites/vagrantpress/wordpress/wp-content/plugins/hello.php",
746
+ "/Users/torounit/Downloads/contact-form-7/wp-contact-form-7.php",
747
+ "/Users/torounit/Sites/vagrantpress/wordpress/wp-includes/atomlib.php",
748
+ "/Users/torounit/Sites/vagrantpress/wordpress/wp-includes/query.php",
749
+ "/private/var/folders/s4/2zp6bm8d7s9_s46_jyvrghfm0000gn/T/344eaae8-a689-4b00-9929-f0d72872fefe/web/torounit.com/test/anchor/composer.json",
750
+ "/private/var/folders/s4/2zp6bm8d7s9_s46_jyvrghfm0000gn/T/344eaae8-a689-4b00-9929-f0d72872fefe/web/torounit.com/test/.htaccess",
751
+ "/Users/torounit/Library/Application Support/Sublime Text 2/Packages/Better CoffeeScript/CoffeeScript.sublime-settings",
752
+ "/Users/torounit/Downloads/ps-taxonomy-expander/ps-taxonomy-expander.php",
753
+ "/Users/torounit/Downloads/contact-form-7/settings.php",
754
+ "/Users/torounit/WordPressSVN/custom-post-type-permalinks/tags/0.9.2.1/custom-post-type-permalinks.php",
755
+ "/Users/torounit/.ssh/known_hosts",
756
+ "/Users/torounit/Sites/vagrant-local/Vagrantfile",
757
+ "/Users/torounit/Sites/vagrantpress/puppet/modules/wordpress/files/wp-config.php",
758
+ "/Users/torounit/Sites/vagrantpress/puppet/modules/wordpress/manifests/init.pp",
759
+ "/Users/torounit/Sites/vagrantpress/puppet/modules/wordpress/files/wordpress-db.sql",
760
+ "/Users/torounit/Downloads/vagrantpress-master/puppet/modules/wordpress/files/wp-config.php",
761
+ "/Users/torounit/GitHub/pppp-vagrantpress/puppet/modules/wordpress/manifests/init.pp",
762
+ "/Users/torounit/Sites/vagrantpress/wordpress/wp-admin/options-reading.php",
763
+ "/Users/torounit/Sites/vagrantpress/wordpress/wp-content/plugins/custom-ppp/custom-ppp.php",
764
+ "/Users/torounit/Sites/vagrantpress/wordpress/wp-admin/options-writing.php",
765
+ "/Users/torounit/Sites/vagrantpress/Vagrantfile",
766
+ "/Users/torounit/Sites/custom-ppp/wp-config.php"
767
+ ],
768
+ "find":
769
+ {
770
+ "height": 36.0
771
+ },
772
+ "find_in_files":
773
+ {
774
+ "height": 96.0,
775
+ "where_history":
776
+ [
777
+ "/Users/torounit/Downloads/wordpress 2",
778
+ "/Users/torounit/Sites/neko",
779
+ "/Users/torounit/Sites/neko/vendor/google",
780
+ "/Users/torounit/Develop/ToroUnit2013/sass",
781
+ "/Users/torounit/Develop/ToroUnit2013",
782
+ "/Users/torounit/Develop/ToroUnit2013/sass",
783
+ "/Users/torounit/Develop/ToroUnit2013",
784
+ "/Users/torounit/Develop/ToroUnit2013/sass",
785
+ "/Users/torounit/Downloads/wordpress",
786
+ "<project>",
787
+ "/Users/torounit/Downloads/wordpress",
788
+ "/Users/torounit/Downloads/buddypress",
789
+ "<project>",
790
+ "/Users/torounit/jbn/tamura/cms",
791
+ "/Users/torounit/jbn/tamura/cms/wp-content/themes/tamura",
792
+ "/Users/torounit/Sites/beitbook",
793
+ "<project>",
794
+ "/Users/torounit/Sites/beitbook",
795
+ "<project>",
796
+ ""
797
+ ]
798
+ },
799
+ "find_state":
800
+ {
801
+ "case_sensitive": false,
802
+ "find_history":
803
+ [
804
+ "/CPTP_Module_",
805
+ "constructor",
806
+ "#{&}",
807
+ "<p>",
808
+ "add_editor_style",
809
+ "cache",
810
+ "$apiConfig",
811
+ "Google_Client",
812
+ "cache",
813
+ "apiConfig",
814
+ "defaultConfig",
815
+ "config.php",
816
+ "cache",
817
+ "Google_FileCache",
818
+ "inclu",
819
+ "$Cache_Lite",
820
+ "Cache_Lite",
821
+ "Google_PlusService",
822
+ "Google_YoutubeService",
823
+ " </div>\n </div>",
824
+ " <div class=\"grid-content\">",
825
+ "<p><a href=\"#\">piyopiyo</a></p>",
826
+ " <p><a href=\"#\">piyopiyo</a></p>",
827
+ " <h3>hoge</h3>",
828
+ " <p>fugafugafuga</p>",
829
+ " <p>\n fugafugafuga\n </p>",
830
+ " hoge",
831
+ "<div class=\"grid\">",
832
+ " <div>",
833
+ "data",
834
+ "set_youtube",
835
+ "min",
836
+ ".content",
837
+ " class=\"content\"",
838
+ "img/",
839
+ "main",
840
+ "content",
841
+ "contentT",
842
+ ".content",
843
+ "/content",
844
+ "neko",
845
+ "cat",
846
+ " '",
847
+ "r",
848
+ "archives",
849
+ "$this->",
850
+ "$this->version",
851
+ "version",
852
+ "default_structure",
853
+ "check_version",
854
+ "get_taxonomy_parents",
855
+ "create_taxonomy_replace_tag",
856
+ "post_type_link",
857
+ "get_archives_link",
858
+ "get_taxonomy_parents",
859
+ "jus",
860
+ "Posts per page for custom post types and taxonomies.",
861
+ "Utility",
862
+ "PPPP::get_taxonomies",
863
+ "PPPP::get_post_types",
864
+ "%s",
865
+ "sh",
866
+ "Custom_PPP",
867
+ "posts_per_page_by_",
868
+ "}\n",
869
+ "get_post",
870
+ "ctrack",
871
+ "date",
872
+ "front",
873
+ "@grid",
874
+ "grid",
875
+ "@SIZE",
876
+ "CELL",
877
+ "_(",
878
+ "size",
879
+ "cell",
880
+ "add_role",
881
+ "get_role",
882
+ "super_admin",
883
+ "$_SERVER['REQUEST_URI']",
884
+ "do_parse_request",
885
+ "g/g",
886
+ "</em>",
887
+ "250px",
888
+ "/iamges",
889
+ "ハンドメニュー",
890
+ "<p>ガーリー&ポップ ",
891
+ "<p>フットジェル ",
892
+ "コース</p>",
893
+ "<br>ハンドメニュー",
894
+ "<p>デイリー",
895
+ "<br>ハンドメニュー",
896
+ "<p>パーティー",
897
+ "パーティー",
898
+ "ガーリー&ポップ",
899
+ "<br>ハンドメニュー",
900
+ "ガーリー&ポップ ",
901
+ "g/g",
902
+ "$sql = \"SELECT blog_id FROM wp_blogs WHERE public = '1' AND blog_id != '1' ORDER BY registered ASC LIMIT %d, %d;\";",
903
+ "registered DESC",
904
+ "last_updated",
905
+ "php",
906
+ "../",
907
+ "images/",
908
+ ",",
909
+ "00",
910
+ "………………",
911
+ "…",
912
+ "ul><li>",
913
+ "\n・",
914
+ "・",
915
+ "</span></a></li>",
916
+ "<li><a href=\"\"><span>",
917
+ "<a href=\"\"></a></li>",
918
+ "    ",
919
+ "@media -sass-debug-info{filename{font-family:file\\:\\/\\/\\/Users\\/sakatadaisuke\\/git\\/tamura\\/cms\\/wp-content\\/themes\\/tamura\\/sass\\/_access\\.sass}line{font-family:",
920
+ "@media -sass-debug-info{filename{font-family:file\\:\\/\\/\\/Users\\/sakatadaisuke\\/git\\/tamura\\/cms\\/wp-content\\/themes\\/tamura\\/sass\\/_spirit\\.sass}line{font-family:",
921
+ "the_ca",
922
+ "get_archive_template",
923
+ "get_archive_template()",
924
+ "\\\"",
925
+ ")\n",
926
+ "add_filter",
927
+ "function add_action",
928
+ "add_action",
929
+ "_publish_post_hook",
930
+ "'publish_post'",
931
+ "do_action('publish_post"
932
+ ],
933
+ "highlight": true,
934
+ "in_selection": false,
935
+ "preserve_case": false,
936
+ "regex": false,
937
+ "replace_history":
938
+ [
939
+ " class=\"contentBox\"",
940
+ "../img/",
941
+ "beitbook.biz"
942
+ ],
943
+ "reverse": false,
944
+ "show_context": true,
945
+ "use_buffer2": true,
946
+ "whole_word": false,
947
+ "wrap": true
948
+ },
949
+ "groups":
950
+ [
951
+ {
952
+ "selected": 7,
953
+ "sheets":
954
+ [
955
+ {
956
+ "buffer": 0,
957
+ "file": "custom-post-type-permalinks.php",
958
+ "semi_transient": false,
959
+ "settings":
960
+ {
961
+ "buffer_size": 516,
962
+ "regions":
963
+ {
964
+ },
965
+ "selection":
966
+ [
967
+ [
968
+ 454,
969
+ 454
970
+ ]
971
+ ],
972
+ "settings":
973
+ {
974
+ "BracketHighlighterBusy": false,
975
+ "bh_regions":
976
+ [
977
+ "bh_angle",
978
+ "bh_angle_center",
979
+ "bh_angle_open",
980
+ "bh_angle_close",
981
+ "bh_curly",
982
+ "bh_curly_center",
983
+ "bh_curly_open",
984
+ "bh_curly_close",
985
+ "bh_regex",
986
+ "bh_regex_center",
987
+ "bh_regex_open",
988
+ "bh_regex_close",
989
+ "bh_round",
990
+ "bh_round_center",
991
+ "bh_round_open",
992
+ "bh_round_close",
993
+ "bh_unmatched",
994
+ "bh_unmatched_center",
995
+ "bh_unmatched_open",
996
+ "bh_unmatched_close",
997
+ "bh_single_quote",
998
+ "bh_single_quote_center",
999
+ "bh_single_quote_open",
1000
+ "bh_single_quote_close",
1001
+ "bh_square",
1002
+ "bh_square_center",
1003
+ "bh_square_open",
1004
+ "bh_square_close",
1005
+ "bh_default",
1006
+ "bh_default_center",
1007
+ "bh_default_open",
1008
+ "bh_default_close",
1009
+ "bh_double_quote",
1010
+ "bh_double_quote_center",
1011
+ "bh_double_quote_open",
1012
+ "bh_double_quote_close",
1013
+ "bh_tag",
1014
+ "bh_tag_center",
1015
+ "bh_tag_open",
1016
+ "bh_tag_close"
1017
+ ],
1018
+ "codeintel": true,
1019
+ "codeintel_config":
1020
+ {
1021
+ "JavaScript":
1022
+ {
1023
+ "codeintel_max_recursive_dir_depth": 2,
1024
+ "codeintel_scan_files_in_project": false,
1025
+ "javascriptExtraPaths":
1026
+ [
1027
+ ]
1028
+ },
1029
+ "PHP":
1030
+ {
1031
+ "codeintel_max_recursive_dir_depth": 5,
1032
+ "codeintel_scan_files_in_project": false,
1033
+ "phpExtraPaths":
1034
+ [
1035
+ ]
1036
+ },
1037
+ "Python":
1038
+ {
1039
+ "env":
1040
+ {
1041
+ }
1042
+ }
1043
+ },
1044
+ "codeintel_enabled_languages":
1045
+ [
1046
+ "JavaScript",
1047
+ "Mason",
1048
+ "XBL",
1049
+ "XUL",
1050
+ "RHTML",
1051
+ "SCSS",
1052
+ "Python",
1053
+ "HTML",
1054
+ "Ruby",
1055
+ "Python3",
1056
+ "XML",
1057
+ "Sass",
1058
+ "XSLT",
1059
+ "Django",
1060
+ "HTML5",
1061
+ "Perl",
1062
+ "CSS",
1063
+ "Twig",
1064
+ "Less",
1065
+ "Smarty",
1066
+ "Node.js",
1067
+ "Tcl",
1068
+ "TemplateToolkit",
1069
+ "PHP"
1070
+ ],
1071
+ "codeintel_live": true,
1072
+ "codeintel_live_enabled_languages":
1073
+ [
1074
+ "JavaScript",
1075
+ "Mason",
1076
+ "XBL",
1077
+ "XUL",
1078
+ "RHTML",
1079
+ "SCSS",
1080
+ "Python",
1081
+ "HTML",
1082
+ "Ruby",
1083
+ "Python3",
1084
+ "XML",
1085
+ "Sass",
1086
+ "XSLT",
1087
+ "Django",
1088
+ "HTML5",
1089
+ "Perl",
1090
+ "CSS",
1091
+ "Twig",
1092
+ "Less",
1093
+ "Smarty",
1094
+ "Node.js",
1095
+ "Tcl",
1096
+ "TemplateToolkit",
1097
+ "PHP"
1098
+ ],
1099
+ "codeintel_max_recursive_dir_depth": 10,
1100
+ "codeintel_scan_exclude_dir":
1101
+ {
1102
+ "JavaScript":
1103
+ [
1104
+ "/build/",
1105
+ "/min/"
1106
+ ]
1107
+ },
1108
+ "codeintel_scan_files_in_project": true,
1109
+ "codeintel_selected_catalogs":
1110
+ [
1111
+ "PyWin32",
1112
+ "jQuery",
1113
+ "Rails"
1114
+ ],
1115
+ "codeintel_snippets": true,
1116
+ "codeintel_syntax_map":
1117
+ {
1118
+ "Python Django": "Python"
1119
+ },
1120
+ "codeintel_tooltips": "popup",
1121
+ "incomplete_sync": null,
1122
+ "remote_loading": false,
1123
+ "sublime_auto_complete": true,
1124
+ "synced": false,
1125
+ "syntax": "Packages/PHP/PHP.tmLanguage",
1126
+ "translate_tabs_to_spaces": false
1127
+ },
1128
+ "translation.x": 0.0,
1129
+ "translation.y": 0.0,
1130
+ "zoom_level": 1.0
1131
+ },
1132
+ "stack_index": 8,
1133
+ "type": "text"
1134
+ },
1135
+ {
1136
+ "buffer": 1,
1137
+ "file": "/Users/torounit/Desktop/jetpack/jetpack.php",
1138
+ "semi_transient": false,
1139
+ "settings":
1140
+ {
1141
+ "buffer_size": 4242,
1142
+ "regions":
1143
+ {
1144
+ },
1145
+ "selection":
1146
+ [
1147
+ [
1148
+ 1092,
1149
+ 1092
1150
+ ]
1151
+ ],
1152
+ "settings":
1153
+ {
1154
+ "BracketHighlighterBusy": false,
1155
+ "bh_regions":
1156
+ [
1157
+ "bh_angle",
1158
+ "bh_angle_center",
1159
+ "bh_angle_open",
1160
+ "bh_angle_close",
1161
+ "bh_curly",
1162
+ "bh_curly_center",
1163
+ "bh_curly_open",
1164
+ "bh_curly_close",
1165
+ "bh_regex",
1166
+ "bh_regex_center",
1167
+ "bh_regex_open",
1168
+ "bh_regex_close",
1169
+ "bh_round",
1170
+ "bh_round_center",
1171
+ "bh_round_open",
1172
+ "bh_round_close",
1173
+ "bh_unmatched",
1174
+ "bh_unmatched_center",
1175
+ "bh_unmatched_open",
1176
+ "bh_unmatched_close",
1177
+ "bh_single_quote",
1178
+ "bh_single_quote_center",
1179
+ "bh_single_quote_open",
1180
+ "bh_single_quote_close",
1181
+ "bh_square",
1182
+ "bh_square_center",
1183
+ "bh_square_open",
1184
+ "bh_square_close",
1185
+ "bh_default",
1186
+ "bh_default_center",
1187
+ "bh_default_open",
1188
+ "bh_default_close",
1189
+ "bh_double_quote",
1190
+ "bh_double_quote_center",
1191
+ "bh_double_quote_open",
1192
+ "bh_double_quote_close",
1193
+ "bh_tag",
1194
+ "bh_tag_center",
1195
+ "bh_tag_open",
1196
+ "bh_tag_close"
1197
+ ],
1198
+ "incomplete_sync": null,
1199
+ "remote_loading": false,
1200
+ "synced": false,
1201
+ "syntax": "Packages/PHP/PHP.tmLanguage"
1202
+ },
1203
+ "translation.x": 0.0,
1204
+ "translation.y": 489.0,
1205
+ "zoom_level": 1.0
1206
+ },
1207
+ "stack_index": 7,
1208
+ "type": "text"
1209
+ },
1210
+ {
1211
+ "buffer": 2,
1212
+ "file": "CPTP/Module/Admin.php",
1213
+ "semi_transient": false,
1214
+ "settings":
1215
+ {
1216
+ "buffer_size": 5297,
1217
+ "regions":
1218
+ {
1219
+ },
1220
+ "selection":
1221
+ [
1222
+ [
1223
+ 3308,
1224
+ 3308
1225
+ ]
1226
+ ],
1227
+ "settings":
1228
+ {
1229
+ "BracketHighlighterBusy": false,
1230
+ "bh_regions":
1231
+ [
1232
+ "bh_angle",
1233
+ "bh_angle_center",
1234
+ "bh_angle_open",
1235
+ "bh_angle_close",
1236
+ "bh_curly",
1237
+ "bh_curly_center",
1238
+ "bh_curly_open",
1239
+ "bh_curly_close",
1240
+ "bh_regex",
1241
+ "bh_regex_center",
1242
+ "bh_regex_open",
1243
+ "bh_regex_close",
1244
+ "bh_round",
1245
+ "bh_round_center",
1246
+ "bh_round_open",
1247
+ "bh_round_close",
1248
+ "bh_unmatched",
1249
+ "bh_unmatched_center",
1250
+ "bh_unmatched_open",
1251
+ "bh_unmatched_close",
1252
+ "bh_single_quote",
1253
+ "bh_single_quote_center",
1254
+ "bh_single_quote_open",
1255
+ "bh_single_quote_close",
1256
+ "bh_square",
1257
+ "bh_square_center",
1258
+ "bh_square_open",
1259
+ "bh_square_close",
1260
+ "bh_default",
1261
+ "bh_default_center",
1262
+ "bh_default_open",
1263
+ "bh_default_close",
1264
+ "bh_double_quote",
1265
+ "bh_double_quote_center",
1266
+ "bh_double_quote_open",
1267
+ "bh_double_quote_close",
1268
+ "bh_tag",
1269
+ "bh_tag_center",
1270
+ "bh_tag_open",
1271
+ "bh_tag_close"
1272
+ ],
1273
+ "codeintel": true,
1274
+ "codeintel_config":
1275
+ {
1276
+ "JavaScript":
1277
+ {
1278
+ "codeintel_max_recursive_dir_depth": 2,
1279
+ "codeintel_scan_files_in_project": false,
1280
+ "javascriptExtraPaths":
1281
+ [
1282
+ ]
1283
+ },
1284
+ "PHP":
1285
+ {
1286
+ "codeintel_max_recursive_dir_depth": 5,
1287
+ "codeintel_scan_files_in_project": false,
1288
+ "phpExtraPaths":
1289
+ [
1290
+ ]
1291
+ },
1292
+ "Python":
1293
+ {
1294
+ "env":
1295
+ {
1296
+ }
1297
+ }
1298
+ },
1299
+ "codeintel_enabled_languages":
1300
+ [
1301
+ "JavaScript",
1302
+ "Mason",
1303
+ "XBL",
1304
+ "XUL",
1305
+ "RHTML",
1306
+ "SCSS",
1307
+ "Python",
1308
+ "HTML",
1309
+ "Ruby",
1310
+ "Python3",
1311
+ "XML",
1312
+ "Sass",
1313
+ "XSLT",
1314
+ "Django",
1315
+ "HTML5",
1316
+ "Perl",
1317
+ "CSS",
1318
+ "Twig",
1319
+ "Less",
1320
+ "Smarty",
1321
+ "Node.js",
1322
+ "Tcl",
1323
+ "TemplateToolkit",
1324
+ "PHP"
1325
+ ],
1326
+ "codeintel_live": true,
1327
+ "codeintel_live_enabled_languages":
1328
+ [
1329
+ "JavaScript",
1330
+ "Mason",
1331
+ "XBL",
1332
+ "XUL",
1333
+ "RHTML",
1334
+ "SCSS",
1335
+ "Python",
1336
+ "HTML",
1337
+ "Ruby",
1338
+ "Python3",
1339
+ "XML",
1340
+ "Sass",
1341
+ "XSLT",
1342
+ "Django",
1343
+ "HTML5",
1344
+ "Perl",
1345
+ "CSS",
1346
+ "Twig",
1347
+ "Less",
1348
+ "Smarty",
1349
+ "Node.js",
1350
+ "Tcl",
1351
+ "TemplateToolkit",
1352
+ "PHP"
1353
+ ],
1354
+ "codeintel_max_recursive_dir_depth": 10,
1355
+ "codeintel_scan_exclude_dir":
1356
+ {
1357
+ "JavaScript":
1358
+ [
1359
+ "/build/",
1360
+ "/min/"
1361
+ ]
1362
+ },
1363
+ "codeintel_scan_files_in_project": true,
1364
+ "codeintel_selected_catalogs":
1365
+ [
1366
+ "PyWin32",
1367
+ "jQuery",
1368
+ "Rails"
1369
+ ],
1370
+ "codeintel_snippets": true,
1371
+ "codeintel_syntax_map":
1372
+ {
1373
+ "Python Django": "Python"
1374
+ },
1375
+ "codeintel_tooltips": "popup",
1376
+ "incomplete_sync": null,
1377
+ "remote_loading": false,
1378
+ "sublime_auto_complete": true,
1379
+ "synced": false,
1380
+ "syntax": "Packages/PHP/PHP.tmLanguage",
1381
+ "translate_tabs_to_spaces": false
1382
+ },
1383
+ "translation.x": 0.0,
1384
+ "translation.y": 1656.0,
1385
+ "zoom_level": 1.0
1386
+ },
1387
+ "stack_index": 1,
1388
+ "type": "text"
1389
+ },
1390
+ {
1391
+ "buffer": 3,
1392
+ "file": "language/cptp-ru_RU.po",
1393
+ "semi_transient": false,
1394
+ "settings":
1395
+ {
1396
+ "buffer_size": 3204,
1397
+ "regions":
1398
+ {
1399
+ },
1400
+ "selection":
1401
+ [
1402
+ [
1403
+ 0,
1404
+ 0
1405
+ ]
1406
+ ],
1407
+ "settings":
1408
+ {
1409
+ "BracketHighlighterBusy": false,
1410
+ "bh_regions":
1411
+ [
1412
+ "bh_angle",
1413
+ "bh_angle_center",
1414
+ "bh_angle_open",
1415
+ "bh_angle_close",
1416
+ "bh_curly",
1417
+ "bh_curly_center",
1418
+ "bh_curly_open",
1419
+ "bh_curly_close",
1420
+ "bh_regex",
1421
+ "bh_regex_center",
1422
+ "bh_regex_open",
1423
+ "bh_regex_close",
1424
+ "bh_round",
1425
+ "bh_round_center",
1426
+ "bh_round_open",
1427
+ "bh_round_close",
1428
+ "bh_unmatched",
1429
+ "bh_unmatched_center",
1430
+ "bh_unmatched_open",
1431
+ "bh_unmatched_close",
1432
+ "bh_single_quote",
1433
+ "bh_single_quote_center",
1434
+ "bh_single_quote_open",
1435
+ "bh_single_quote_close",
1436
+ "bh_square",
1437
+ "bh_square_center",
1438
+ "bh_square_open",
1439
+ "bh_square_close",
1440
+ "bh_default",
1441
+ "bh_default_center",
1442
+ "bh_default_open",
1443
+ "bh_default_close",
1444
+ "bh_double_quote",
1445
+ "bh_double_quote_center",
1446
+ "bh_double_quote_open",
1447
+ "bh_double_quote_close",
1448
+ "bh_tag",
1449
+ "bh_tag_center",
1450
+ "bh_tag_open",
1451
+ "bh_tag_close"
1452
+ ],
1453
+ "incomplete_sync": null,
1454
+ "remote_loading": false,
1455
+ "synced": false,
1456
+ "syntax": "Packages/Text/Plain text.tmLanguage"
1457
+ },
1458
+ "translation.x": 0.0,
1459
+ "translation.y": 0.0,
1460
+ "zoom_level": 1.0
1461
+ },
1462
+ "stack_index": 5,
1463
+ "type": "text"
1464
+ },
1465
+ {
1466
+ "buffer": 4,
1467
+ "file": "language/cptp-ja.po",
1468
+ "semi_transient": false,
1469
+ "settings":
1470
+ {
1471
+ "buffer_size": 2549,
1472
+ "regions":
1473
+ {
1474
+ },
1475
+ "selection":
1476
+ [
1477
+ [
1478
+ 0,
1479
+ 0
1480
+ ]
1481
+ ],
1482
+ "settings":
1483
+ {
1484
+ "BracketHighlighterBusy": false,
1485
+ "codeintel": true,
1486
+ "codeintel_config":
1487
+ {
1488
+ "JavaScript":
1489
+ {
1490
+ "codeintel_max_recursive_dir_depth": 2,
1491
+ "codeintel_scan_files_in_project": false,
1492
+ "javascriptExtraPaths":
1493
+ [
1494
+ ]
1495
+ },
1496
+ "PHP":
1497
+ {
1498
+ "codeintel_max_recursive_dir_depth": 5,
1499
+ "codeintel_scan_files_in_project": false,
1500
+ "phpExtraPaths":
1501
+ [
1502
+ ]
1503
+ },
1504
+ "Python":
1505
+ {
1506
+ "env":
1507
+ {
1508
+ }
1509
+ }
1510
+ },
1511
+ "codeintel_enabled_languages":
1512
+ [
1513
+ "JavaScript",
1514
+ "Mason",
1515
+ "XBL",
1516
+ "XUL",
1517
+ "RHTML",
1518
+ "SCSS",
1519
+ "Python",
1520
+ "HTML",
1521
+ "Ruby",
1522
+ "Python3",
1523
+ "XML",
1524
+ "Sass",
1525
+ "XSLT",
1526
+ "Django",
1527
+ "HTML5",
1528
+ "Perl",
1529
+ "CSS",
1530
+ "Twig",
1531
+ "Less",
1532
+ "Smarty",
1533
+ "Node.js",
1534
+ "Tcl",
1535
+ "TemplateToolkit",
1536
+ "PHP"
1537
+ ],
1538
+ "codeintel_live": true,
1539
+ "codeintel_live_enabled_languages":
1540
+ [
1541
+ "JavaScript",
1542
+ "Mason",
1543
+ "XBL",
1544
+ "XUL",
1545
+ "RHTML",
1546
+ "SCSS",
1547
+ "Python",
1548
+ "HTML",
1549
+ "Ruby",
1550
+ "Python3",
1551
+ "XML",
1552
+ "Sass",
1553
+ "XSLT",
1554
+ "Django",
1555
+ "HTML5",
1556
+ "Perl",
1557
+ "CSS",
1558
+ "Twig",
1559
+ "Less",
1560
+ "Smarty",
1561
+ "Node.js",
1562
+ "Tcl",
1563
+ "TemplateToolkit",
1564
+ "PHP"
1565
+ ],
1566
+ "codeintel_max_recursive_dir_depth": 10,
1567
+ "codeintel_scan_exclude_dir":
1568
+ {
1569
+ "JavaScript":
1570
+ [
1571
+ "/build/",
1572
+ "/min/"
1573
+ ]
1574
+ },
1575
+ "codeintel_scan_files_in_project": true,
1576
+ "codeintel_selected_catalogs":
1577
+ [
1578
+ "PyWin32",
1579
+ "jQuery",
1580
+ "Rails"
1581
+ ],
1582
+ "codeintel_snippets": true,
1583
+ "codeintel_syntax_map":
1584
+ {
1585
+ "Python Django": "Python"
1586
+ },
1587
+ "codeintel_tooltips": "popup",
1588
+ "incomplete_sync": null,
1589
+ "remote_loading": false,
1590
+ "sublime_auto_complete": true,
1591
+ "synced": false,
1592
+ "syntax": "Packages/Text/Plain text.tmLanguage"
1593
+ },
1594
+ "translation.x": 0.0,
1595
+ "translation.y": 0.0,
1596
+ "zoom_level": 1.0
1597
+ },
1598
+ "stack_index": 4,
1599
+ "type": "text"
1600
+ },
1601
+ {
1602
+ "buffer": 5,
1603
+ "file": "CPTP.php",
1604
+ "semi_transient": false,
1605
+ "settings":
1606
+ {
1607
+ "buffer_size": 1091,
1608
+ "regions":
1609
+ {
1610
+ },
1611
+ "selection":
1612
+ [
1613
+ [
1614
+ 274,
1615
+ 274
1616
+ ]
1617
+ ],
1618
+ "settings":
1619
+ {
1620
+ "BracketHighlighterBusy": false,
1621
+ "bh_regions":
1622
+ [
1623
+ "bh_angle",
1624
+ "bh_angle_center",
1625
+ "bh_angle_open",
1626
+ "bh_angle_close",
1627
+ "bh_curly",
1628
+ "bh_curly_center",
1629
+ "bh_curly_open",
1630
+ "bh_curly_close",
1631
+ "bh_regex",
1632
+ "bh_regex_center",
1633
+ "bh_regex_open",
1634
+ "bh_regex_close",
1635
+ "bh_round",
1636
+ "bh_round_center",
1637
+ "bh_round_open",
1638
+ "bh_round_close",
1639
+ "bh_unmatched",
1640
+ "bh_unmatched_center",
1641
+ "bh_unmatched_open",
1642
+ "bh_unmatched_close",
1643
+ "bh_single_quote",
1644
+ "bh_single_quote_center",
1645
+ "bh_single_quote_open",
1646
+ "bh_single_quote_close",
1647
+ "bh_square",
1648
+ "bh_square_center",
1649
+ "bh_square_open",
1650
+ "bh_square_close",
1651
+ "bh_default",
1652
+ "bh_default_center",
1653
+ "bh_default_open",
1654
+ "bh_default_close",
1655
+ "bh_double_quote",
1656
+ "bh_double_quote_center",
1657
+ "bh_double_quote_open",
1658
+ "bh_double_quote_close",
1659
+ "bh_tag",
1660
+ "bh_tag_center",
1661
+ "bh_tag_open",
1662
+ "bh_tag_close"
1663
+ ],
1664
+ "codeintel": true,
1665
+ "codeintel_config":
1666
+ {
1667
+ "JavaScript":
1668
+ {
1669
+ "codeintel_max_recursive_dir_depth": 2,
1670
+ "codeintel_scan_files_in_project": false,
1671
+ "javascriptExtraPaths":
1672
+ [
1673
+ ]
1674
+ },
1675
+ "PHP":
1676
+ {
1677
+ "codeintel_max_recursive_dir_depth": 5,
1678
+ "codeintel_scan_files_in_project": false,
1679
+ "phpExtraPaths":
1680
+ [
1681
+ ]
1682
+ },
1683
+ "Python":
1684
+ {
1685
+ "env":
1686
+ {
1687
+ }
1688
+ }
1689
+ },
1690
+ "codeintel_enabled_languages":
1691
+ [
1692
+ "JavaScript",
1693
+ "Mason",
1694
+ "XBL",
1695
+ "XUL",
1696
+ "RHTML",
1697
+ "SCSS",
1698
+ "Python",
1699
+ "HTML",
1700
+ "Ruby",
1701
+ "Python3",
1702
+ "XML",
1703
+ "Sass",
1704
+ "XSLT",
1705
+ "Django",
1706
+ "HTML5",
1707
+ "Perl",
1708
+ "CSS",
1709
+ "Twig",
1710
+ "Less",
1711
+ "Smarty",
1712
+ "Node.js",
1713
+ "Tcl",
1714
+ "TemplateToolkit",
1715
+ "PHP"
1716
+ ],
1717
+ "codeintel_live": true,
1718
+ "codeintel_live_enabled_languages":
1719
+ [
1720
+ "JavaScript",
1721
+ "Mason",
1722
+ "XBL",
1723
+ "XUL",
1724
+ "RHTML",
1725
+ "SCSS",
1726
+ "Python",
1727
+ "HTML",
1728
+ "Ruby",
1729
+ "Python3",
1730
+ "XML",
1731
+ "Sass",
1732
+ "XSLT",
1733
+ "Django",
1734
+ "HTML5",
1735
+ "Perl",
1736
+ "CSS",
1737
+ "Twig",
1738
+ "Less",
1739
+ "Smarty",
1740
+ "Node.js",
1741
+ "Tcl",
1742
+ "TemplateToolkit",
1743
+ "PHP"
1744
+ ],
1745
+ "codeintel_max_recursive_dir_depth": 10,
1746
+ "codeintel_scan_exclude_dir":
1747
+ {
1748
+ "JavaScript":
1749
+ [
1750
+ "/build/",
1751
+ "/min/"
1752
+ ]
1753
+ },
1754
+ "codeintel_scan_files_in_project": true,
1755
+ "codeintel_selected_catalogs":
1756
+ [
1757
+ "PyWin32",
1758
+ "jQuery",
1759
+ "Rails"
1760
+ ],
1761
+ "codeintel_snippets": true,
1762
+ "codeintel_syntax_map":
1763
+ {
1764
+ "Python Django": "Python"
1765
+ },
1766
+ "codeintel_tooltips": "popup",
1767
+ "incomplete_sync": null,
1768
+ "remote_loading": false,
1769
+ "sublime_auto_complete": true,
1770
+ "synced": false,
1771
+ "syntax": "Packages/PHP/PHP.tmLanguage",
1772
+ "translate_tabs_to_spaces": false
1773
+ },
1774
+ "translation.x": 0.0,
1775
+ "translation.y": 5.0,
1776
+ "zoom_level": 1.0
1777
+ },
1778
+ "stack_index": 3,
1779
+ "type": "text"
1780
+ },
1781
+ {
1782
+ "buffer": 6,
1783
+ "file": "CPTP/Util.php",
1784
+ "semi_transient": false,
1785
+ "settings":
1786
+ {
1787
+ "buffer_size": 1494,
1788
+ "regions":
1789
+ {
1790
+ },
1791
+ "selection":
1792
+ [
1793
+ [
1794
+ 91,
1795
+ 91
1796
+ ]
1797
+ ],
1798
+ "settings":
1799
+ {
1800
+ "BracketHighlighterBusy": false,
1801
+ "bh_regions":
1802
+ [
1803
+ "bh_angle",
1804
+ "bh_angle_center",
1805
+ "bh_angle_open",
1806
+ "bh_angle_close",
1807
+ "bh_curly",
1808
+ "bh_curly_center",
1809
+ "bh_curly_open",
1810
+ "bh_curly_close",
1811
+ "bh_regex",
1812
+ "bh_regex_center",
1813
+ "bh_regex_open",
1814
+ "bh_regex_close",
1815
+ "bh_round",
1816
+ "bh_round_center",
1817
+ "bh_round_open",
1818
+ "bh_round_close",
1819
+ "bh_unmatched",
1820
+ "bh_unmatched_center",
1821
+ "bh_unmatched_open",
1822
+ "bh_unmatched_close",
1823
+ "bh_single_quote",
1824
+ "bh_single_quote_center",
1825
+ "bh_single_quote_open",
1826
+ "bh_single_quote_close",
1827
+ "bh_square",
1828
+ "bh_square_center",
1829
+ "bh_square_open",
1830
+ "bh_square_close",
1831
+ "bh_default",
1832
+ "bh_default_center",
1833
+ "bh_default_open",
1834
+ "bh_default_close",
1835
+ "bh_double_quote",
1836
+ "bh_double_quote_center",
1837
+ "bh_double_quote_open",
1838
+ "bh_double_quote_close",
1839
+ "bh_tag",
1840
+ "bh_tag_center",
1841
+ "bh_tag_open",
1842
+ "bh_tag_close"
1843
+ ],
1844
+ "codeintel": true,
1845
+ "codeintel_config":
1846
+ {
1847
+ "JavaScript":
1848
+ {
1849
+ "codeintel_max_recursive_dir_depth": 2,
1850
+ "codeintel_scan_files_in_project": false,
1851
+ "javascriptExtraPaths":
1852
+ [
1853
+ ]
1854
+ },
1855
+ "PHP":
1856
+ {
1857
+ "codeintel_max_recursive_dir_depth": 5,
1858
+ "codeintel_scan_files_in_project": false,
1859
+ "phpExtraPaths":
1860
+ [
1861
+ ]
1862
+ },
1863
+ "Python":
1864
+ {
1865
+ "env":
1866
+ {
1867
+ }
1868
+ }
1869
+ },
1870
+ "codeintel_enabled_languages":
1871
+ [
1872
+ "JavaScript",
1873
+ "Mason",
1874
+ "XBL",
1875
+ "XUL",
1876
+ "RHTML",
1877
+ "SCSS",
1878
+ "Python",
1879
+ "HTML",
1880
+ "Ruby",
1881
+ "Python3",
1882
+ "XML",
1883
+ "Sass",
1884
+ "XSLT",
1885
+ "Django",
1886
+ "HTML5",
1887
+ "Perl",
1888
+ "CSS",
1889
+ "Twig",
1890
+ "Less",
1891
+ "Smarty",
1892
+ "Node.js",
1893
+ "Tcl",
1894
+ "TemplateToolkit",
1895
+ "PHP"
1896
+ ],
1897
+ "codeintel_live": true,
1898
+ "codeintel_live_enabled_languages":
1899
+ [
1900
+ "JavaScript",
1901
+ "Mason",
1902
+ "XBL",
1903
+ "XUL",
1904
+ "RHTML",
1905
+ "SCSS",
1906
+ "Python",
1907
+ "HTML",
1908
+ "Ruby",
1909
+ "Python3",
1910
+ "XML",
1911
+ "Sass",
1912
+ "XSLT",
1913
+ "Django",
1914
+ "HTML5",
1915
+ "Perl",
1916
+ "CSS",
1917
+ "Twig",
1918
+ "Less",
1919
+ "Smarty",
1920
+ "Node.js",
1921
+ "Tcl",
1922
+ "TemplateToolkit",
1923
+ "PHP"
1924
+ ],
1925
+ "codeintel_max_recursive_dir_depth": 10,
1926
+ "codeintel_scan_exclude_dir":
1927
+ {
1928
+ "JavaScript":
1929
+ [
1930
+ "/build/",
1931
+ "/min/"
1932
+ ]
1933
+ },
1934
+ "codeintel_scan_files_in_project": true,
1935
+ "codeintel_selected_catalogs":
1936
+ [
1937
+ "PyWin32",
1938
+ "jQuery",
1939
+ "Rails"
1940
+ ],
1941
+ "codeintel_snippets": true,
1942
+ "codeintel_syntax_map":
1943
+ {
1944
+ "Python Django": "Python"
1945
+ },
1946
+ "codeintel_tooltips": "popup",
1947
+ "incomplete_sync": null,
1948
+ "remote_loading": false,
1949
+ "sublime_auto_complete": true,
1950
+ "synced": false,
1951
+ "syntax": "Packages/PHP/PHP.tmLanguage",
1952
+ "translate_tabs_to_spaces": false
1953
+ },
1954
+ "translation.x": 0.0,
1955
+ "translation.y": 0.0,
1956
+ "zoom_level": 1.0
1957
+ },
1958
+ "stack_index": 2,
1959
+ "type": "text"
1960
+ },
1961
+ {
1962
+ "buffer": 7,
1963
+ "file": "CPTP/Module/Permalink.php",
1964
+ "semi_transient": false,
1965
+ "settings":
1966
+ {
1967
+ "buffer_size": 6301,
1968
+ "regions":
1969
+ {
1970
+ },
1971
+ "selection":
1972
+ [
1973
+ [
1974
+ 2883,
1975
+ 2883
1976
+ ]
1977
+ ],
1978
+ "settings":
1979
+ {
1980
+ "BracketHighlighterBusy": false,
1981
+ "bh_regions":
1982
+ [
1983
+ "bh_angle",
1984
+ "bh_angle_center",
1985
+ "bh_angle_open",
1986
+ "bh_angle_close",
1987
+ "bh_curly",
1988
+ "bh_curly_center",
1989
+ "bh_curly_open",
1990
+ "bh_curly_close",
1991
+ "bh_regex",
1992
+ "bh_regex_center",
1993
+ "bh_regex_open",
1994
+ "bh_regex_close",
1995
+ "bh_round",
1996
+ "bh_round_center",
1997
+ "bh_round_open",
1998
+ "bh_round_close",
1999
+ "bh_unmatched",
2000
+ "bh_unmatched_center",
2001
+ "bh_unmatched_open",
2002
+ "bh_unmatched_close",
2003
+ "bh_single_quote",
2004
+ "bh_single_quote_center",
2005
+ "bh_single_quote_open",
2006
+ "bh_single_quote_close",
2007
+ "bh_square",
2008
+ "bh_square_center",
2009
+ "bh_square_open",
2010
+ "bh_square_close",
2011
+ "bh_default",
2012
+ "bh_default_center",
2013
+ "bh_default_open",
2014
+ "bh_default_close",
2015
+ "bh_double_quote",
2016
+ "bh_double_quote_center",
2017
+ "bh_double_quote_open",
2018
+ "bh_double_quote_close",
2019
+ "bh_tag",
2020
+ "bh_tag_center",
2021
+ "bh_tag_open",
2022
+ "bh_tag_close"
2023
+ ],
2024
+ "codeintel": true,
2025
+ "codeintel_config":
2026
+ {
2027
+ "JavaScript":
2028
+ {
2029
+ "codeintel_max_recursive_dir_depth": 2,
2030
+ "codeintel_scan_files_in_project": false,
2031
+ "javascriptExtraPaths":
2032
+ [
2033
+ ]
2034
+ },
2035
+ "PHP":
2036
+ {
2037
+ "codeintel_max_recursive_dir_depth": 5,
2038
+ "codeintel_scan_files_in_project": false,
2039
+ "phpExtraPaths":
2040
+ [
2041
+ ]
2042
+ },
2043
+ "Python":
2044
+ {
2045
+ "env":
2046
+ {
2047
+ }
2048
+ }
2049
+ },
2050
+ "codeintel_enabled_languages":
2051
+ [
2052
+ "JavaScript",
2053
+ "Mason",
2054
+ "XBL",
2055
+ "XUL",
2056
+ "RHTML",
2057
+ "SCSS",
2058
+ "Python",
2059
+ "HTML",
2060
+ "Ruby",
2061
+ "Python3",
2062
+ "XML",
2063
+ "Sass",
2064
+ "XSLT",
2065
+ "Django",
2066
+ "HTML5",
2067
+ "Perl",
2068
+ "CSS",
2069
+ "Twig",
2070
+ "Less",
2071
+ "Smarty",
2072
+ "Node.js",
2073
+ "Tcl",
2074
+ "TemplateToolkit",
2075
+ "PHP"
2076
+ ],
2077
+ "codeintel_live": true,
2078
+ "codeintel_live_enabled_languages":
2079
+ [
2080
+ "JavaScript",
2081
+ "Mason",
2082
+ "XBL",
2083
+ "XUL",
2084
+ "RHTML",
2085
+ "SCSS",
2086
+ "Python",
2087
+ "HTML",
2088
+ "Ruby",
2089
+ "Python3",
2090
+ "XML",
2091
+ "Sass",
2092
+ "XSLT",
2093
+ "Django",
2094
+ "HTML5",
2095
+ "Perl",
2096
+ "CSS",
2097
+ "Twig",
2098
+ "Less",
2099
+ "Smarty",
2100
+ "Node.js",
2101
+ "Tcl",
2102
+ "TemplateToolkit",
2103
+ "PHP"
2104
+ ],
2105
+ "codeintel_max_recursive_dir_depth": 10,
2106
+ "codeintel_scan_exclude_dir":
2107
+ {
2108
+ "JavaScript":
2109
+ [
2110
+ "/build/",
2111
+ "/min/"
2112
+ ]
2113
+ },
2114
+ "codeintel_scan_files_in_project": true,
2115
+ "codeintel_selected_catalogs":
2116
+ [
2117
+ "PyWin32",
2118
+ "jQuery",
2119
+ "Rails"
2120
+ ],
2121
+ "codeintel_snippets": true,
2122
+ "codeintel_syntax_map":
2123
+ {
2124
+ "Python Django": "Python"
2125
+ },
2126
+ "codeintel_tooltips": "popup",
2127
+ "incomplete_sync": null,
2128
+ "remote_loading": false,
2129
+ "sublime_auto_complete": true,
2130
+ "synced": false,
2131
+ "syntax": "Packages/PHP/PHP.tmLanguage",
2132
+ "translate_tabs_to_spaces": false
2133
+ },
2134
+ "translation.x": 0.0,
2135
+ "translation.y": 229.0,
2136
+ "zoom_level": 1.0
2137
+ },
2138
+ "stack_index": 0,
2139
+ "type": "text"
2140
+ },
2141
+ {
2142
+ "buffer": 8,
2143
+ "file": "/Users/torounit/GitHub/cptp-test-vagrant/Vagrantfile",
2144
+ "semi_transient": false,
2145
+ "settings":
2146
+ {
2147
+ "buffer_size": 4312,
2148
+ "regions":
2149
+ {
2150
+ },
2151
+ "selection":
2152
+ [
2153
+ [
2154
+ 98,
2155
+ 98
2156
+ ]
2157
+ ],
2158
+ "settings":
2159
+ {
2160
+ "BracketHighlighterBusy": false,
2161
+ "bh_regions":
2162
+ [
2163
+ "bh_angle",
2164
+ "bh_angle_center",
2165
+ "bh_angle_open",
2166
+ "bh_angle_close",
2167
+ "bh_curly",
2168
+ "bh_curly_center",
2169
+ "bh_curly_open",
2170
+ "bh_curly_close",
2171
+ "bh_regex",
2172
+ "bh_regex_center",
2173
+ "bh_regex_open",
2174
+ "bh_regex_close",
2175
+ "bh_round",
2176
+ "bh_round_center",
2177
+ "bh_round_open",
2178
+ "bh_round_close",
2179
+ "bh_unmatched",
2180
+ "bh_unmatched_center",
2181
+ "bh_unmatched_open",
2182
+ "bh_unmatched_close",
2183
+ "bh_single_quote",
2184
+ "bh_single_quote_center",
2185
+ "bh_single_quote_open",
2186
+ "bh_single_quote_close",
2187
+ "bh_square",
2188
+ "bh_square_center",
2189
+ "bh_square_open",
2190
+ "bh_square_close",
2191
+ "bh_default",
2192
+ "bh_default_center",
2193
+ "bh_default_open",
2194
+ "bh_default_close",
2195
+ "bh_double_quote",
2196
+ "bh_double_quote_center",
2197
+ "bh_double_quote_open",
2198
+ "bh_double_quote_close",
2199
+ "bh_tag",
2200
+ "bh_tag_center",
2201
+ "bh_tag_open",
2202
+ "bh_tag_close"
2203
+ ],
2204
+ "codeintel": true,
2205
+ "codeintel_config":
2206
+ {
2207
+ "JavaScript":
2208
+ {
2209
+ "codeintel_max_recursive_dir_depth": 2,
2210
+ "codeintel_scan_files_in_project": false,
2211
+ "javascriptExtraPaths":
2212
+ [
2213
+ ]
2214
+ },
2215
+ "PHP":
2216
+ {
2217
+ "codeintel_max_recursive_dir_depth": 5,
2218
+ "codeintel_scan_files_in_project": false,
2219
+ "phpExtraPaths":
2220
+ [
2221
+ ]
2222
+ },
2223
+ "Python":
2224
+ {
2225
+ "env":
2226
+ {
2227
+ }
2228
+ }
2229
+ },
2230
+ "codeintel_enabled_languages":
2231
+ [
2232
+ "JavaScript",
2233
+ "Mason",
2234
+ "XBL",
2235
+ "XUL",
2236
+ "RHTML",
2237
+ "SCSS",
2238
+ "Python",
2239
+ "HTML",
2240
+ "Ruby",
2241
+ "Python3",
2242
+ "XML",
2243
+ "Sass",
2244
+ "XSLT",
2245
+ "Django",
2246
+ "HTML5",
2247
+ "Perl",
2248
+ "CSS",
2249
+ "Twig",
2250
+ "Less",
2251
+ "Smarty",
2252
+ "Node.js",
2253
+ "Tcl",
2254
+ "TemplateToolkit",
2255
+ "PHP"
2256
+ ],
2257
+ "codeintel_live": true,
2258
+ "codeintel_live_enabled_languages":
2259
+ [
2260
+ "JavaScript",
2261
+ "Mason",
2262
+ "XBL",
2263
+ "XUL",
2264
+ "RHTML",
2265
+ "SCSS",
2266
+ "Python",
2267
+ "HTML",
2268
+ "Ruby",
2269
+ "Python3",
2270
+ "XML",
2271
+ "Sass",
2272
+ "XSLT",
2273
+ "Django",
2274
+ "HTML5",
2275
+ "Perl",
2276
+ "CSS",
2277
+ "Twig",
2278
+ "Less",
2279
+ "Smarty",
2280
+ "Node.js",
2281
+ "Tcl",
2282
+ "TemplateToolkit",
2283
+ "PHP"
2284
+ ],
2285
+ "codeintel_max_recursive_dir_depth": 10,
2286
+ "codeintel_scan_exclude_dir":
2287
+ {
2288
+ "JavaScript":
2289
+ [
2290
+ "/build/",
2291
+ "/min/"
2292
+ ]
2293
+ },
2294
+ "codeintel_scan_files_in_project": true,
2295
+ "codeintel_selected_catalogs":
2296
+ [
2297
+ "PyWin32",
2298
+ "jQuery",
2299
+ "Rails"
2300
+ ],
2301
+ "codeintel_snippets": true,
2302
+ "codeintel_syntax_map":
2303
+ {
2304
+ "Python Django": "Python"
2305
+ },
2306
+ "codeintel_tooltips": "popup",
2307
+ "incomplete_sync": null,
2308
+ "remote_loading": false,
2309
+ "sublime_auto_complete": true,
2310
+ "synced": false,
2311
+ "syntax": "Packages/Ruby/Ruby.tmLanguage",
2312
+ "tab_size": 2,
2313
+ "translate_tabs_to_spaces": true
2314
+ },
2315
+ "translation.x": 0.0,
2316
+ "translation.y": 0.0,
2317
+ "zoom_level": 1.0
2318
+ },
2319
+ "stack_index": 6,
2320
+ "type": "text"
2321
+ }
2322
+ ]
2323
+ }
2324
+ ],
2325
+ "incremental_find":
2326
+ {
2327
+ "height": 28.0
2328
+ },
2329
+ "input":
2330
+ {
2331
+ "height": 36.0
2332
+ },
2333
+ "layout":
2334
+ {
2335
+ "cells":
2336
+ [
2337
+ [
2338
+ 0,
2339
+ 0,
2340
+ 1,
2341
+ 1
2342
+ ]
2343
+ ],
2344
+ "cols":
2345
+ [
2346
+ 0.0,
2347
+ 1.0
2348
+ ],
2349
+ "rows":
2350
+ [
2351
+ 0.0,
2352
+ 1.0
2353
+ ]
2354
+ },
2355
+ "menu_visible": true,
2356
+ "output.exec":
2357
+ {
2358
+ "height": 130.0
2359
+ },
2360
+ "output.find_results":
2361
+ {
2362
+ "height": 0.0
2363
+ },
2364
+ "output.sftp":
2365
+ {
2366
+ "height": 130.0
2367
+ },
2368
+ "project": "cptp.sublime-project",
2369
+ "replace":
2370
+ {
2371
+ "height": 52.0
2372
+ },
2373
+ "save_all_on_build": true,
2374
+ "select_file":
2375
+ {
2376
+ "height": 0.0,
2377
+ "selected_items":
2378
+ [
2379
+ ],
2380
+ "width": 0.0
2381
+ },
2382
+ "select_project":
2383
+ {
2384
+ "height": 500.0,
2385
+ "selected_items":
2386
+ [
2387
+ ],
2388
+ "width": 380.0
2389
+ },
2390
+ "select_symbol":
2391
+ {
2392
+ "height": 0.0,
2393
+ "selected_items":
2394
+ [
2395
+ ],
2396
+ "width": 0.0
2397
+ },
2398
+ "settings":
2399
+ {
2400
+ },
2401
+ "show_minimap": true,
2402
+ "show_open_files": true,
2403
+ "show_tabs": true,
2404
+ "side_bar_visible": true,
2405
+ "side_bar_width": 286.0,
2406
+ "status_bar_visible": true,
2407
+ "template_settings":
2408
+ {
2409
+ }
2410
+ }
custom-post-type-permalinks.php CHANGED
@@ -5,807 +5,25 @@ 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: 0.9.3.3
9
  Text Domain: cptp
10
  License: GPL2 or later
11
  Domain Path: /language/
12
  */
13
 
14
 
15
- /* Copyright 2012 Toro_Unit (email : mail@torounit.com)
16
-
17
- This program is free software; you can redistribute it and/or modify
18
- it under the terms of the GNU General Public License as published by
19
- the Free Software Foundation; either version 2 of the License, or
20
- (at your option) any later version.
21
-
22
- This program is distributed in the hope that it will be useful,
23
- but WITHOUT ANY WARRANTY; without even the implied warranty of
24
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
- GNU General Public License for more details.
26
-
27
- You should have received a copy of the GNU General Public License
28
- along with this program; if not, write to the Free Software
29
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30
- */
31
-
32
-
33
-
34
  /**
35
  *
36
  * Custom Post Type Permalinks
37
  *
 
 
38
  *
39
  */
40
- class Custom_Post_Type_Permalinks {
41
-
42
-
43
-
44
-
45
- public $version = "0.9";
46
-
47
- public $default_structure = '/%postname%/';
48
-
49
- /**
50
- *
51
- * Add Action & filter hooks.
52
- *
53
- */
54
- public function add_hook () {
55
-
56
- add_action( 'plugins_loaded', array(&$this,'check_version') );
57
- add_action( 'wp_loaded', array(&$this,'add_archive_rewrite_rules'), 99 );
58
- add_action( 'wp_loaded', array(&$this,'add_tax_rewrite_rules') );
59
- add_action( 'wp_loaded', array(&$this, "dequeue_flush_rules"),100);
60
- add_action( 'parse_request', array(&$this, "parse_request") );
61
- add_action( 'registered_post_type', array(&$this,'registered_post_type'), 10, 2 );
62
-
63
-
64
- if(get_option( "permalink_structure") != "") {
65
- add_filter( 'post_type_link', array(&$this,'post_type_link'), 10, 4 );
66
- add_filter( 'getarchives_join', array(&$this,'getarchives_join'), 10, 2 ); // [steve]
67
- add_filter( 'getarchives_where', array(&$this,'getarchives_where'), 10 , 2 );
68
- add_filter( 'get_archives_link', array(&$this,'get_archives_link'), 20, 1 );
69
- add_filter( 'term_link', array(&$this,'term_link'), 10, 3 );
70
- add_filter( 'attachment_link', array(&$this, 'attachment_link'), 20 , 2);
71
- }
72
-
73
-
74
- add_action( 'init', array(&$this,'load_textdomain') );
75
- add_action( 'init', array(&$this, 'update_rules') );
76
- add_action( 'update_option_cptp_version', array(&$this, 'update_rules') );
77
- add_action( 'admin_init', array(&$this,'settings_api_init'), 30 );
78
- add_action( 'admin_enqueue_scripts', array(&$this,'enqueue_css_js') );
79
- add_action( 'admin_footer', array(&$this,'pointer_js') );
80
-
81
-
82
- }
83
-
84
- /**
85
- *
86
- * dequeue flush rules
87
- * @since 0.9
88
- *
89
- */
90
-
91
- public function dequeue_flush_rules () {
92
- if(get_option("queue_flush_rules")){
93
- flush_rewrite_rules();
94
- update_option( "queue_flush_rules", 0 );
95
-
96
- }
97
- }
98
-
99
-
100
- /**
101
- *
102
- * dequeue flush rules
103
- * @since 0.8.6
104
- *
105
- */
106
-
107
- public function check_version() {
108
- $version = get_option('cptp_version', 0);
109
- if($version != $this->version) {
110
- update_option('cptp_version', $this->version);
111
- }
112
- }
113
-
114
- /**
115
- *
116
- * Get Custom Taxonomies parents.
117
- * @version 1.0
118
- *
119
- */
120
- private function get_taxonomy_parents( $id, $taxonomy = 'category', $link = false, $separator = '/', $nicename = false, $visited = array() ) {
121
- $chain = '';
122
- $parent = &get_term( $id, $taxonomy, OBJECT, 'raw');
123
- if ( is_wp_error( $parent ) ) {
124
- return $parent;
125
- }
126
-
127
- if ( $nicename ){
128
- $name = $parent->slug;
129
- }else {
130
- $name = $parent->name;
131
- }
132
-
133
- if ( $parent->parent && ( $parent->parent != $parent->term_id ) && !in_array( $parent->parent, $visited ) ) {
134
- $visited[] = $parent->parent;
135
- $chain .= $this->get_taxonomy_parents( $parent->parent, $taxonomy, $link, $separator, $nicename, $visited );
136
- }
137
-
138
- if ( $link ) {
139
- $chain .= '<a href="' . get_term_link( $parent->term_id, $taxonomy ) . '" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $parent->name ) ) . '">'.$name.'</a>' . $separator;
140
- }else {
141
- $chain .= $name.$separator;
142
- }
143
- return $chain;
144
- }
145
-
146
-
147
-
148
- /**
149
- *
150
- * Add rewrite rules for archives.
151
- * @version 1.1
152
- *
153
- */
154
- public function add_archive_rewrite_rules() {
155
- $post_types = get_post_types( array('_builtin'=>false, 'publicly_queryable'=>true,'show_ui' => true) );
156
-
157
- foreach ( $post_types as $post_type ):
158
- if( !$post_type ) {
159
- continue;
160
- }
161
-
162
- $permalink = get_option( $post_type.'_structure' );
163
- $post_type_obj = get_post_type_object($post_type);
164
- $slug = $post_type_obj->rewrite['slug'];
165
- if( !$slug )
166
- $slug = $post_type;
167
-
168
- if( $post_type_obj->has_archive ){
169
- if( is_string( $post_type_obj->has_archive ) ){
170
- $slug = $post_type_obj->has_archive;
171
- };
172
-
173
-
174
- add_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]&post_type='.$post_type, 'top' );
175
- add_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]&post_type='.$post_type, 'top' );
176
- add_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&paged=$matches[4]&post_type='.$post_type, 'top' );
177
- add_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&post_type='.$post_type, 'top' );
178
- add_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]&post_type='.$post_type, 'top' );
179
- add_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]&post_type='.$post_type, 'top' );
180
- add_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&paged=$matches[3]&post_type='.$post_type, 'top' );
181
- add_rewrite_rule( $slug.'/date/([0-9]{4})/([0-9]{1,2})/?$', 'index.php?year=$matches[1]&monthnum=$matches[2]&post_type='.$post_type, 'top' );
182
- add_rewrite_rule( $slug.'/date/([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&feed=$matches[2]&post_type='.$post_type, 'top' );
183
- add_rewrite_rule( $slug.'/date/([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$', 'index.php?year=$matches[1]&feed=$matches[2]&post_type='.$post_type, 'top' );
184
- add_rewrite_rule( $slug.'/date/([0-9]{4})/page/?([0-9]{1,})/?$', 'index.php?year=$matches[1]&paged=$matches[2]&post_type='.$post_type, 'top' );
185
- add_rewrite_rule( $slug.'/date/([0-9]{4})/?$', 'index.php?year=$matches[1]&post_type='.$post_type, 'top' );
186
- add_rewrite_rule( $slug.'/author/([^/]+)/?$', 'index.php?author_name=$matches[1]&post_type='.$post_type, 'top' );
187
- }
188
-
189
-
190
- endforeach;
191
- }
192
-
193
- /**
194
- *
195
- * registered_post_type
196
- * ** add rewrite tag for Custom Post Type.
197
- * @version 1.1
198
- * @since 0.9
199
- *
200
- */
201
-
202
- public function registered_post_type( $post_type, $args ) {
203
-
204
- global $wp_post_types, $wp_rewrite, $wp;
205
-
206
- if( $args->_builtin or !$args->publicly_queryable or !$args->show_ui ){
207
- return false;
208
- }
209
- $permalink = get_option( $post_type.'_structure' );
210
-
211
- if( !$permalink ) {
212
- $permalink = $this->default_structure;
213
- }
214
-
215
- $permalink = '%'.$post_type.'_slug%'.$permalink;
216
- $permalink = str_replace( '%postname%', '%'.$post_type.'%', $permalink );
217
-
218
- add_rewrite_tag( '%'.$post_type.'_slug%', '('.$args->rewrite['slug'].')','post_type='.$post_type.'&slug=' );
219
-
220
- $taxonomies = get_taxonomies( array("show_ui" => true, "_builtin" => false), 'objects' );
221
- foreach ( $taxonomies as $taxonomy => $objects ):
222
- $wp_rewrite->add_rewrite_tag( "%$taxonomy%", '(.+?)', "$taxonomy=" );
223
- endforeach;
224
-
225
- $permalink = trim($permalink, "/" );
226
- $rewrite_args = $args->rewrite;
227
- $rewrite_args["walk_dirs"] = false;
228
- add_permastruct( $post_type, $permalink, $rewrite_args);
229
-
230
- }
231
-
232
-
233
-
234
-
235
-
236
- /**
237
- *
238
- * fix attachment output
239
- *
240
- * @version 1.0
241
- * @since 0.8.2
242
- *
243
- */
244
-
245
- public function attachment_link( $link , $postID ) {
246
- $post = get_post( $postID );
247
- if (!$post->post_parent){
248
- return $link;
249
- }
250
- $post_parent = get_post( $post->post_parent );
251
- $permalink = get_option( $post_parent->post_type.'_structure' );
252
- $post_type = get_post_type_object( $post_parent->post_type );
253
-
254
- if( $post_type->_builtin == false ) {
255
- if(strpos( $permalink, "%postname%" ) < strrpos( $permalink, "%post_id%" ) && strrpos( $permalink, "attachment/" ) === FALSE ){
256
- $link = str_replace($post->post_name , "attachment/".$post->post_name, $link);
257
- }
258
- }
259
-
260
- return $link;
261
- }
262
-
263
-
264
-
265
- /**
266
- *
267
- * Fix permalinks output.
268
- *
269
- * @param String $post_link
270
- * @param Object $post 投稿情報
271
- * @param String $leavename 記事編集画面でのみ渡される
272
- *
273
- * @version 2.0
274
- *
275
- */
276
- public function post_type_link( $post_link, $post, $leavename ) {
277
-
278
- global $wp_rewrite;
279
- $draft_or_pending = isset( $post->post_status ) && in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft' ) );
280
- if( $draft_or_pending and !$leavename )
281
- return $post_link;
282
-
283
- $post_type = $post->post_type;
284
- $permalink = $wp_rewrite->get_extra_permastruct( $post_type );
285
- $permalink = str_replace( '%post_id%', $post->ID, $permalink );
286
- $permalink = str_replace( '%'.$post_type.'_slug%', get_post_type_object( $post_type )->rewrite['slug'], $permalink );
287
-
288
-
289
- $parentsDirs = "";
290
- if( !$leavename ){
291
- $postId = $post->ID;
292
- while ($parent = get_post($postId)->post_parent) {
293
- $parentsDirs = get_post($parent)->post_name."/".$parentsDirs;
294
- $postId = $parent;
295
- }
296
- }
297
-
298
- $permalink = str_replace( '%'.$post_type.'%', $parentsDirs.'%'.$post_type.'%', $permalink );
299
-
300
- if( !$leavename ){
301
- $permalink = str_replace( '%'.$post_type.'%', $post->post_name, $permalink );
302
- }
303
-
304
- //%post_id%/attachment/%attachement_name%;
305
- //画像の編集ページでのリンク
306
- if( isset($_GET["post"]) && $_GET["post"] != $post->ID ) {
307
- $parent_structure = trim(get_option( $post->post_type.'_structure' ), "/");
308
- if( "%post_id%" == $parent_structure or "%post_id%" == array_pop( explode( "/", $parent_structure ) ) ) {
309
- $permalink = $permalink."/attachment/";
310
- };
311
- }
312
-
313
- $taxonomies = get_taxonomies( array('show_ui' => true),'objects' );
314
-
315
- //%taxnomomy% -> parent/child
316
- //運用でケアすべきかも。
317
- foreach ( $taxonomies as $taxonomy => $objects ) {
318
- if ( strpos($permalink, "%$taxonomy%") !== false ) {
319
- $terms = wp_get_post_terms( $post->ID, $taxonomy, array('orderby' => 'term_id'));
320
- if ( $terms and count($terms) > 1 ) {
321
- if(reset($terms)->parent == 0){
322
-
323
- $keys = array_keys($terms);
324
- $term = $terms[$keys[1]]->slug;
325
- if ( $terms[$keys[0]]->term_id == $terms[$keys[1]]->parent ) {
326
- $term = $this->get_taxonomy_parents( $terms[$keys[1]]->parent,$taxonomy, false, '/', true ) . $term;
327
- }
328
- }else{
329
- $keys = array_keys($terms);
330
- $term = $terms[$keys[0]]->slug;
331
- if ( $terms[$keys[1]]->term_id == $terms[$keys[0]]->parent ) {
332
- $term = $this->get_taxonomy_parents( $terms[$keys[0]]->parent,$taxonomy, false, '/', true ) . $term;
333
- }
334
- }
335
- }else if( $terms ){
336
-
337
- $term_obj = array_shift($terms);
338
- $term = $term_obj->slug;
339
-
340
- if(isset($term_obj->parent) and $term_obj->parent != 0) {
341
- $term = $this->get_taxonomy_parents( $term_obj->parent,$taxonomy, false, '/', true ) . $term;
342
- }
343
- }
344
-
345
- if( isset($term) ) {
346
- $permalink = str_replace( "%$taxonomy%", $term, $permalink );
347
- }
348
- }
349
- }
350
-
351
- $user = get_userdata( $post->post_author );
352
- if(isset($user->user_nicename)) {
353
- $permalink = str_replace( "%author%", $user->user_nicename, $permalink );
354
- }
355
-
356
- $post_date = strtotime( $post->post_date );
357
- $permalink = str_replace( "%year%", date("Y",$post_date), $permalink );
358
- $permalink = str_replace( "%monthnum%", date("m",$post_date), $permalink );
359
- $permalink = str_replace( "%day%", date("d",$post_date), $permalink );
360
- $permalink = str_replace( "%hour%", date("H",$post_date), $permalink );
361
- $permalink = str_replace( "%minute%", date("i",$post_date), $permalink );
362
- $permalink = str_replace( "%second%", date("s",$post_date), $permalink );
363
-
364
-
365
- $permalink = home_url()."/".user_trailingslashit( $permalink );
366
- $permalink = str_replace("//", "/", $permalink);
367
- $permalink = str_replace(":/", "://", $permalink);
368
- return $permalink;
369
- }
370
-
371
-
372
-
373
- /**
374
- *
375
- * wp_get_archives fix for custom post
376
- * Ex:wp_get_archives('&post_type='.get_query_var( 'post_type' ));
377
- * @version 2.0
378
- *
379
- */
380
-
381
- public $get_archives_where_r;
382
-
383
- // function modified by [steve]
384
- public function getarchives_where( $where, $r ) {
385
- $this->get_archives_where_r = $r;
386
- if ( isset($r['post_type']) ) {
387
- $where = str_replace( '\'post\'', '\'' . $r['post_type'] . '\'', $where );
388
- }
389
-
390
- if(isset($r['taxonomy']) && is_array($r['taxonomy']) ){
391
- global $wpdb;
392
- $where = $where . " AND $wpdb->term_taxonomy.taxonomy = '".$r['taxonomy']['name']."' AND $wpdb->term_taxonomy.term_id = '".$r['taxonomy']['termid']."'";
393
- }
394
-
395
- return $where;
396
- }
397
-
398
-
399
-
400
- //function added by [steve]
401
- /**
402
- *
403
- * get_archive_join
404
- * @author Steve
405
- * @since 0.8
406
- * @version 1.0
407
- *
408
- *
409
- */
410
- public function getarchives_join( $join, $r ) {
411
- global $wpdb;
412
- $this->get_archives_where_r = $r;
413
- if(isset($r['taxonomy']) && is_array($r['taxonomy']) )
414
- $join = $join . " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)";
415
-
416
- return $join;
417
- }
418
-
419
-
420
-
421
- /**
422
- *
423
- * get_arcihves_link
424
- * @version 2.1
425
- *
426
- */
427
- public function get_archives_link( $link ) {
428
- if(!isset($this->get_archives_where_r['post_type'])) {
429
- return $link;
430
- }
431
- $c = isset($this->get_archives_where_r['taxonomy']) && is_array($this->get_archives_where_r['taxonomy']) ? $this->get_archives_where_r['taxonomy'] : ""; //[steve]
432
- $t = $this->get_archives_where_r['post_type'];
433
-
434
-
435
- $this->get_archives_where_r['post_type'] = isset($this->get_archives_where_r['post_type_slug']) ? $this->get_archives_where_r['post_type_slug'] : $t; // [steve] [*** bug fixing]
436
-
437
- if (isset($this->get_archives_where_r['post_type']) and $this->get_archives_where_r['type'] != 'postbypost'){
438
- $blog_url = rtrim( get_bloginfo("url") ,'/');
439
-
440
- //remove .ext
441
- $str = preg_replace("/\.[a-z,_]*/","",get_option("permalink_structure"));
442
-
443
- if($str = rtrim( preg_replace("/%[a-z,_]*%/","",$str) ,'/')) { // /archive/%post_id%
444
- $ret_link = str_replace($str, '/'.'%link_dir%', $link);
445
- }else{
446
- $blog_url = preg_replace('/https?:\/\//', '', $blog_url);
447
- $ret_link = str_replace($blog_url,$blog_url.'/'.'%link_dir%',$link);
448
- }
449
-
450
- $post_type = get_post_type_object( $this->get_archives_where_r['post_type'] );
451
- if(empty($c) ){ // [steve]
452
- if(isset( $post_type->rewrite["slug"] )) {
453
- $link_dir = $post_type->rewrite["slug"];
454
- }
455
- else{
456
- $link_dir = $this->get_archives_where_r['post_type'];
457
- }
458
- }
459
- else{ // [steve]
460
- $c['name'] = ($c['name'] == 'category' && get_option('category_base')) ? get_option('category_base') : $c['name'];
461
- $link_dir = $post_type->rewrite["slug"]."/".$c['name']."/".$c['termslug'];
462
- }
463
-
464
- if(!strstr($link,'/date/')){
465
- $link_dir = $link_dir .'/date';
466
- }
467
-
468
- $ret_link = str_replace('%link_dir%',$link_dir,$ret_link);
469
- }else {
470
- $ret_link = $link;
471
- }
472
- $this->get_archives_where_r['post_type'] = $t; // [steve] reverting post_type to previous value
473
-
474
- return $ret_link;
475
- }
476
-
477
-
478
-
479
- /**
480
- *
481
- * Add rewrite rules for custom taxonomies.
482
- * @since 0.6
483
- * @version 2.1
484
- *
485
- */
486
- public function add_tax_rewrite_rules() {
487
- if(get_option('no_taxonomy_structure')) {
488
- return false;
489
- }
490
-
491
-
492
- global $wp_rewrite;
493
- $taxonomies = get_taxonomies(array( '_builtin' => false));
494
- $taxonomies['category'] = 'category';
495
-
496
- if(empty($taxonomies)) {
497
- return false;
498
- }
499
-
500
- foreach ($taxonomies as $taxonomy) :
501
- $taxonomyObject = get_taxonomy($taxonomy);
502
- $post_types = $taxonomyObject->object_type;
503
-
504
- foreach ($post_types as $post_type):
505
- $post_type_obj = get_post_type_object($post_type);
506
- $slug = $post_type_obj->rewrite['slug'];
507
- if(!$slug) {
508
- $slug = $post_type;
509
- }
510
-
511
- if(is_string($post_type_obj->has_archive)) {
512
- $slug = $post_type_obj->has_archive;
513
- };
514
-
515
- if ( $taxonomy == 'category' ){
516
- $taxonomypat = ($cb = get_option('category_base')) ? $cb : $taxonomy;
517
- $tax = 'category_name';
518
- } else {
519
- // Edit by [Xiphe]
520
- if (isset($taxonomyObject->rewrite['slug'])) {
521
- $taxonomypat = $taxonomyObject->rewrite['slug'];
522
- } else {
523
- $taxonomypat = $taxonomy;
524
- }
525
- // [Xiphe] stop
526
-
527
- $tax = $taxonomy;
528
- }
529
-
530
-
531
- //add taxonomy slug
532
- add_rewrite_rule( $slug.'/'.$taxonomypat.'/(.+?)/page/?([0-9]{1,})/?$', 'index.php?'.$tax.'=$matches[1]&paged=$matches[2]', 'top' );
533
- add_rewrite_rule( $slug.'/'.$taxonomypat.'/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$', 'index.php?'.$tax.'=$matches[1]&feed=$matches[2]', 'top' );
534
- add_rewrite_rule( $slug.'/'.$taxonomypat.'/(.+?)/(feed|rdf|rss|rss2|atom)/?$', 'index.php?'.$tax.'=$matches[1]&feed=$matches[2]', 'top' );
535
- add_rewrite_rule( $slug.'/'.$taxonomypat.'/(.+?)/?$', 'index.php?'.$tax.'=$matches[1]', 'top' ); // modified by [steve] [*** bug fixing]
536
-
537
- // below rules were added by [steve]
538
- add_rewrite_rule( $taxonomypat.'/(.+?)/date/([0-9]{4})/([0-9]{1,2})/?$', 'index.php?'.$tax.'=$matches[1]&year=$matches[2]&monthnum=$matches[3]&post_type='.$post_type, 'top' );
539
- add_rewrite_rule( $taxonomypat.'/(.+?)/date/([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$', 'index.php?'.$tax.'=$matches[1]&year=$matches[2]&monthnum=$matches[3]&paged=$matches[4]&post_type='.$post_type, 'top' );
540
- add_rewrite_rule( $slug.'/'.$taxonomypat.'/(.+?)/date/([0-9]{4})/([0-9]{1,2})/?$', 'index.php?'.$tax.'=$matches[1]&year=$matches[2]&monthnum=$matches[3]&post_type='.$post_type, 'top' );
541
- add_rewrite_rule( $slug.'/'.$taxonomypat.'/(.+?)/date/([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$', 'index.php?'.$tax.'=$matches[1]&year=$matches[2]&monthnum=$matches[3]&paged=$matches[4]&post_type='.$post_type, 'top' );
542
-
543
- endforeach;
544
- endforeach;
545
- }
546
-
547
-
548
-
549
-
550
- /**
551
- *
552
- * Fix taxonomy link outputs.
553
- * @since 0.6
554
- * @version 1.0
555
- *
556
- */
557
- public function term_link( $termlink, $term, $taxonomy ) {
558
- if( get_option('no_taxonomy_structure') ) {
559
- return $termlink;
560
- }
561
-
562
- $taxonomy = get_taxonomy($taxonomy);
563
- if( $taxonomy->_builtin )
564
- return $termlink;
565
-
566
- if( empty($taxonomy) )
567
- return $termlink;
568
-
569
- $wp_home = rtrim( home_url(), '/' );
570
-
571
- $post_type = $taxonomy->object_type[0];
572
- $slug = get_post_type_object($post_type)->rewrite['slug'];
573
- $with_front = get_post_type_object($post_type)->rewrite['with_front'];
574
-
575
- //$termlink = str_replace( $term->slug.'/', $this->get_taxonomy_parents( $term->term_id,$taxonomy->name, false, '/', true ), $termlink );
576
-
577
- //拡張子を削除。
578
- $str = array_shift(explode(".", get_option("permalink_structure")));
579
- $str = rtrim( preg_replace( "/%[a-z_]*%/", "" ,$str) ,'/' );//remove with front
580
- $termlink = str_replace($str."/", "/", $termlink );
581
-
582
- if( $with_front === false ) {
583
- $str = "";
584
- }
585
- $slug = $str."/".$slug;
586
-
587
- $termlink = str_replace( $wp_home, $wp_home.$slug, $termlink );
588
- $termlink = str_replace( $term->slug.'/', $this->get_taxonomy_parents( $term->term_id,$taxonomy->name, false, '/', true ), $termlink );
589
- return $termlink;
590
- }
591
-
592
- /**
593
- *
594
- * Fix taxonomy = parent/child => taxonomy => child
595
- * @since 0.9.3
596
- *
597
- */
598
- public function parse_request($obj) {
599
- $taxes = get_taxonomies(array( '_builtin' => false));
600
- foreach ($taxes as $key => $tax) {
601
- if(isset($obj->query_vars[$tax])) {
602
- if(strpos( $obj->query_vars[$tax] ,"/") !== false ) {
603
- $obj->query_vars[$tax] = array_pop(explode("/", $obj->query_vars[$tax]));
604
- }
605
- }
606
- }
607
- }
608
-
609
-
610
-
611
- /**
612
- *
613
- * load textdomain
614
- * @since 0.6.2
615
- *
616
- */
617
- public function load_textdomain() {
618
- load_plugin_textdomain('cptp',false,'custom-post-type-permalinks/language');
619
- }
620
-
621
-
622
-
623
- /**
624
- *
625
- * Add hook flush_rules
626
- * @since 0.7.9
627
- *
628
- */
629
- public function update_rules() {
630
-
631
- $post_types = get_post_types( array('_builtin'=>false, 'publicly_queryable'=>true, 'show_ui' => true) );
632
- $type_count = count($post_types);
633
- $i = 0;
634
- foreach ($post_types as $post_type):
635
- add_action('update_option_'.$post_type.'_structure',array(&$this,'queue_flush_rules'),10,2);
636
- endforeach;
637
- add_action('update_option_no_taxonomy_structure',array(&$this,'queue_flush_rules'),10,2);
638
- }
639
-
640
-
641
-
642
- /**
643
- * Flush rules
644
- *
645
- * @since 0.7.9
646
- *
647
- */
648
-
649
- public function queue_flush_rules(){
650
- update_option( "queue_flush_rules", 1 );
651
- }
652
-
653
-
654
-
655
- /**
656
- *
657
- * Setting Init
658
- * @since 0.7
659
- *
660
- */
661
- public function settings_api_init() {
662
- add_settings_section('cptp_setting_section',
663
- __("Permalink Setting for custom post type",'cptp'),
664
- array(&$this,'setting_section_callback_function'),
665
- 'permalink'
666
- );
667
-
668
- $post_types = get_post_types( array('_builtin'=>false, 'publicly_queryable'=>true, 'show_ui' => true) );
669
- foreach ($post_types as $post_type):
670
- if(isset($_POST['submit']) and isset($_POST['_wp_http_referer'])){
671
- if( strpos($_POST['_wp_http_referer'],'options-permalink.php') !== FALSE ) {
672
-
673
- $structure = trim(esc_attr($_POST[$post_type.'_structure']));#get setting
674
-
675
- #default permalink structure
676
- if( !$structure )
677
- $structure = $this->default_structure;
678
-
679
- $structure = str_replace('//','/','/'.$structure);# first "/"
680
-
681
- #last "/"
682
- $lastString = substr(trim(esc_attr($_POST['permalink_structure'])),-1);
683
- $structure = rtrim($structure,'/');
684
-
685
- if ( $lastString == '/')
686
- $structure = $structure.'/';
687
-
688
- update_option($post_type.'_structure', $structure );
689
- }
690
- }
691
-
692
- add_settings_field($post_type.'_structure',
693
- $post_type,
694
- array(&$this,'setting_structure_callback_function'),
695
- 'permalink',
696
- 'cptp_setting_section',
697
- $post_type.'_structure'
698
- );
699
-
700
- register_setting('permalink',$post_type.'_structure');
701
- endforeach;
702
-
703
- add_settings_field(
704
- 'no_taxonomy_structure',
705
- __("Use custom permalink of custom taxonomy archive.",'cptp'),
706
- array(&$this,'setting_no_tax_structure_callback_function'),
707
- 'permalink',
708
- 'cptp_setting_section'
709
- );
710
-
711
- register_setting('permalink','no_taxonomy_structure');
712
-
713
- if(isset($_POST['submit']) && isset($_POST['_wp_http_referer']) && strpos($_POST['_wp_http_referer'],'options-permalink.php') !== FALSE ) {
714
-
715
- if(!isset($_POST['no_taxonomy_structure'])){
716
- $set = true;
717
- }else {
718
- $set = false;
719
- }
720
- update_option('no_taxonomy_structure', $set);
721
- }
722
- }
723
-
724
- public function setting_section_callback_function() {
725
- ?>
726
- <p><?php _e("Setting permalinks of custom post type.",'cptp');?><br />
727
- <?php _e("The tags you can use is WordPress Structure Tags and '%\"custom_taxonomy_slug\"%'. (e.g. %actors%)",'cptp');?><br />
728
- <?php _e("%\"custom_taxonomy_slug\"% is replaced the taxonomy's term.'.",'cptp');?></p>
729
-
730
- <p><?php _e("Presence of the trailing '/' is unified into a standard permalink structure setting.",'cptp');?>
731
- <?php _e("If you don't entered permalink structure, permalink is configured /%postname%/'.",'cptp');?>
732
- </p>
733
- <?php
734
- }
735
-
736
- public function setting_structure_callback_function( $option ) {
737
- $post_type = str_replace('_structure',"" ,$option);
738
- $slug = get_post_type_object($post_type)->rewrite['slug'];
739
- $with_front = get_post_type_object($post_type)->rewrite['with_front'];
740
-
741
- $value = get_option($option);
742
- if( !$value )
743
- $value = $this->default_structure;
744
-
745
- global $wp_rewrite;
746
- $front = substr( $wp_rewrite->front, 1 );
747
- if( $front and $with_front ) {
748
- $slug = $front.$slug;
749
- }
750
-
751
- echo '<code>'.home_url().'/'.$slug.'</code> <input name="'.$option.'" id="'.$option.'" type="text" class="regular-text code" value="' . $value .'" />';
752
- }
753
-
754
- public function setting_no_tax_structure_callback_function(){
755
- echo '<input name="no_taxonomy_structure" id="no_taxonomy_structure" type="checkbox" value="1" class="code" ' . checked( false, get_option('no_taxonomy_structure'),false) . ' /> ';
756
- $txt = __("If you check,The custom taxonomy's permalinks is <code>%s/post_type/taxonomy/term</code>.","cptp");
757
- printf($txt , home_url());
758
- }
759
-
760
-
761
-
762
- /**
763
- *
764
- * enqueue CSS and JS
765
- * @since 0.8.5
766
- *
767
- */
768
- public function enqueue_css_js() {
769
- wp_enqueue_style('wp-pointer');
770
- wp_enqueue_script('wp-pointer');
771
- }
772
-
773
 
774
 
775
- /**
776
- *
777
- * add js for pointer
778
- * @since 0.8.5
779
- */
780
- public function pointer_js() {
781
- if(!is_network_admin()) {
782
- $dismissed = explode(',', get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ));
783
- if(array_search('cptp_pointer0871', $dismissed) === false){
784
- $content = __("<h3>Custom Post Type Permalinks</h3><p>From <a href='options-permalink.php'>Permalinks</a>, set a custom permalink for each post type.</p>", "cptp");
785
- ?>
786
- <script type="text/javascript">
787
- jQuery(function($) {
788
 
789
- $("#menu-settings .wp-has-submenu").pointer({
790
- content: "<?php echo $content;?>",
791
- position: {"edge":"left","align":"center"},
792
- close: function() {
793
- $.post('admin-ajax.php', {
794
- action:'dismiss-wp-pointer',
795
- pointer: 'cptp_pointer0871'
796
- })
797
 
798
- }
799
- }).pointer("open");
800
- });
801
- </script>
802
- <?php
803
- }
804
- }
805
- }
806
- }
807
 
808
- $custom_post_type_permalinks = new Custom_Post_Type_Permalinks;
809
- $custom_post_type_permalinks = apply_filters('custom_post_type_permalinks', $custom_post_type_permalinks);
810
- $custom_post_type_permalinks->add_hook();
811
- ?>
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: 0.9.5
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 0.9.4
21
  *
22
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
 
25
+ require_once dirname(__FILE__).'/CPTP.php';
 
 
 
 
 
 
 
 
 
 
 
 
26
 
27
+ CPTP::get_instance();
 
 
 
 
 
 
 
28
 
 
 
 
 
 
 
 
 
 
29
 
 
 
 
 
language/cptp-ja.mo CHANGED
Binary file
language/cptp-ja.po CHANGED
@@ -2,8 +2,8 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Custom Post Type Permalinks\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2012-11-28 18:45+0900\n"
6
- "PO-Revision-Date: 2012-11-28 18:45+0900\n"
7
  "Last-Translator: Toro_Unit <mail@torounit.com>\n"
8
  "Language-Team: Toro_Unit <mail@torounit.com>\n"
9
  "Language: ja_JP\n"
@@ -11,29 +11,23 @@ msgstr ""
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
  "X-Poedit-KeywordsList: _;gettext;gettext_noop;_e;__\n"
14
- "X-Poedit-Basepath: C:\\Users\\Toro-Unit\\Documents\\Develop\\custom-post-"
15
- "type-permalinks\\wp-content\\plugins\\\n"
16
- "X-Generator: Poedit 1.5.4\n"
17
- "X-Poedit-SearchPath-0: custom-post-type-permalinks\n"
18
 
19
- #: custom-post-type-permalinks/custom-post-type-permalinks.php:108
20
- #, php-format
21
- msgid "View all posts in %s"
22
- msgstr "%s のすべての投稿を見る"
23
-
24
- #: custom-post-type-permalinks/custom-post-type-permalinks.php:552
25
  msgid "Permalink Setting for custom post type"
26
  msgstr "カスタム投稿タイプのパーマリンクの設定"
27
 
28
- #: custom-post-type-permalinks/custom-post-type-permalinks.php:594
29
  msgid "Use custom permalink of custom taxonomy archive."
30
  msgstr "カスタム分類のアーカイブのパーマリンクを変更する。"
31
 
32
- #: custom-post-type-permalinks/custom-post-type-permalinks.php:615
33
  msgid "Setting permalinks of custom post type."
34
  msgstr "カスタム投稿タイプごとのパーマリンク構造を設定できます。"
35
 
36
- #: custom-post-type-permalinks/custom-post-type-permalinks.php:616
37
  msgid ""
38
  "The tags you can use is WordPress Structure Tags and '%\"custom_taxonomy_slug"
39
  "\"%'. (e.g. %actors%)"
@@ -41,23 +35,31 @@ msgstr ""
41
  "使用できるタグは、WordPress標準のタグと '%\"カスタム分類名\"%' です。 (例: "
42
  "%actors%)"
43
 
44
- #: custom-post-type-permalinks/custom-post-type-permalinks.php:617
45
  msgid "%\"custom_taxonomy_slug\"% is replaced the taxonomy's term.'."
46
  msgstr "'%\"カスタム分類名\"%' は、そのカスタム分類のタームに置換されます。"
47
 
48
- #: custom-post-type-permalinks/custom-post-type-permalinks.php:619
49
  msgid ""
50
  "Presence of the trailing '/' is unified into a standard permalink structure "
51
  "setting."
52
  msgstr "末尾の '/' の有無は、標準のパーマリンク構造の設定に統一されます。"
53
 
54
- #: custom-post-type-permalinks/custom-post-type-permalinks.php:620
 
 
 
 
 
 
 
 
55
  msgid ""
56
  "If you don't entered permalink structure, permalink is configured /%postname"
57
  "%/'."
58
  msgstr "未入力のときは、/%postname%/ に設定されます。"
59
 
60
- #: custom-post-type-permalinks/custom-post-type-permalinks.php:640
61
  #, php-format
62
  msgid ""
63
  "If you check,The custom taxonomy's permalinks is <code>%s/post_type/taxonomy/"
@@ -66,7 +68,7 @@ msgstr ""
66
  "チェックした場合、カスタム分類のアーカイブのパーマリンクは <code>%s/"
67
  "post_type/taxonomy/term</code>. に変更されます。"
68
 
69
- #: custom-post-type-permalinks/custom-post-type-permalinks.php:668
70
  msgid ""
71
  "<h3>Custom Post Type Permalinks</h3><p>From <a href='options-permalink."
72
  "php'>Permalinks</a>, set a custom permalink for each post type.</p>"
@@ -74,6 +76,9 @@ msgstr ""
74
  "<h3>Custom Post Type Permalinks</h3><p><a href='options-permalink.php'>パーマ"
75
  "リンク設定</a>より、カスタム投稿タイプごとのパーマリンクを設定できます。</p>"
76
 
 
 
 
77
  #~ msgid "From Permalinks, set a custom permalink for each post type."
78
  #~ msgstr ""
79
  #~ "パーマリンク設定より、カスタム投稿タイプごとのパーマリンクを設定できます。"
2
  msgstr ""
3
  "Project-Id-Version: Custom Post Type Permalinks\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2013-12-17 03:03+0900\n"
6
+ "PO-Revision-Date: 2013-12-17 03:03+0900\n"
7
  "Last-Translator: Toro_Unit <mail@torounit.com>\n"
8
  "Language-Team: Toro_Unit <mail@torounit.com>\n"
9
  "Language: ja_JP\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
  "X-Poedit-KeywordsList: _;gettext;gettext_noop;_e;__\n"
14
+ "X-Poedit-Basepath: ../\n"
15
+ "X-Generator: Poedit 1.6.2\n"
16
+ "X-Poedit-SearchPath-0: CPTP/Module\n"
 
17
 
18
+ #: CPTP/Module/Admin.php:30
 
 
 
 
 
19
  msgid "Permalink Setting for custom post type"
20
  msgstr "カスタム投稿タイプのパーマリンクの設定"
21
 
22
+ #: CPTP/Module/Admin.php:72
23
  msgid "Use custom permalink of custom taxonomy archive."
24
  msgstr "カスタム分類のアーカイブのパーマリンクを変更する。"
25
 
26
+ #: CPTP/Module/Admin.php:93
27
  msgid "Setting permalinks of custom post type."
28
  msgstr "カスタム投稿タイプごとのパーマリンク構造を設定できます。"
29
 
30
+ #: CPTP/Module/Admin.php:94
31
  msgid ""
32
  "The tags you can use is WordPress Structure Tags and '%\"custom_taxonomy_slug"
33
  "\"%'. (e.g. %actors%)"
35
  "使用できるタグは、WordPress標準のタグと '%\"カスタム分類名\"%' です。 (例: "
36
  "%actors%)"
37
 
38
+ #: CPTP/Module/Admin.php:95
39
  msgid "%\"custom_taxonomy_slug\"% is replaced the taxonomy's term.'."
40
  msgstr "'%\"カスタム分類名\"%' は、そのカスタム分類のタームに置換されます。"
41
 
42
+ #: CPTP/Module/Admin.php:97
43
  msgid ""
44
  "Presence of the trailing '/' is unified into a standard permalink structure "
45
  "setting."
46
  msgstr "末尾の '/' の有無は、標準のパーマリンク構造の設定に統一されます。"
47
 
48
+ #: CPTP/Module/Admin.php:98
49
+ msgid ""
50
+ "If <code>has_archive</code> is true, add permalinks for custom post type "
51
+ "archive."
52
+ msgstr ""
53
+ "<code>has_archive</code>がtrueの場合、カスタム投稿タイプのアーカイブのパーマ"
54
+ "リンクを追加します。"
55
+
56
+ #: CPTP/Module/Admin.php:99
57
  msgid ""
58
  "If you don't entered permalink structure, permalink is configured /%postname"
59
  "%/'."
60
  msgstr "未入力のときは、/%postname%/ に設定されます。"
61
 
62
+ #: CPTP/Module/Admin.php:128
63
  #, php-format
64
  msgid ""
65
  "If you check,The custom taxonomy's permalinks is <code>%s/post_type/taxonomy/"
68
  "チェックした場合、カスタム分類のアーカイブのパーマリンクは <code>%s/"
69
  "post_type/taxonomy/term</code>. に変更されます。"
70
 
71
+ #: CPTP/Module/Admin.php:156
72
  msgid ""
73
  "<h3>Custom Post Type Permalinks</h3><p>From <a href='options-permalink."
74
  "php'>Permalinks</a>, set a custom permalink for each post type.</p>"
76
  "<h3>Custom Post Type Permalinks</h3><p><a href='options-permalink.php'>パーマ"
77
  "リンク設定</a>より、カスタム投稿タイプごとのパーマリンクを設定できます。</p>"
78
 
79
+ #~ msgid "View all posts in %s"
80
+ #~ msgstr "%s のすべての投稿を見る"
81
+
82
  #~ msgid "From Permalinks, set a custom permalink for each post type."
83
  #~ msgstr ""
84
  #~ "パーマリンク設定より、カスタム投稿タイプごとのパーマリンクを設定できます。"
license.txt ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright 2012 Toro_Unit (email : mail@torounit.com)
2
+
3
+ This program is free software; you can redistribute it and/or modify
4
+ it under the terms of the GNU General Public License as published by
5
+ the Free Software Foundation; either version 2 of the License, or
6
+ (at your option) any later version.
7
+
8
+ This program is distributed in the hope that it will be useful,
9
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ GNU General Public License for more details.
12
+
13
+ You should have received a copy of the GNU General Public License
14
+ along with this program; if not, write to the Free Software
15
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
readme.txt CHANGED
@@ -1,35 +1,35 @@
1
  === Custom Post Type Permalinks ===
2
  Contributors: Toro_Unit
3
  Tags: permalink,permalinks,custom post type,custom taxonomy,cms
4
- Requires at least: 3.4
5
- Tested up to: 3.6
6
- Stable tag: 0.9.3.3
7
 
8
  Lets you edit the permalink of custom post type.
9
 
10
- == Description ==
11
 
12
  Custom Post Type Permalinks lets you edit the permalink structure of custom post type.
13
 
14
  Change custom taxonomy archive's permalink to "example.org/post_type/taxonomy_name/term_slug". Can disable this fix.
15
 
 
 
16
  [This Plugin published on GitHub.](https://github.com/torounit/custom-post-type-permalinks)
17
 
18
  Donation: Please send amazon.co.jp Gift to donate[at]torounit.com.
19
-
20
- = Translators =
21
- * Japanese(ja) - [Toro_Unit](http://www.torounit.com/)
22
  * Russian(ru_RU) - [Olart](http://olart.ru)
23
 
24
 
25
  == Installation ==
26
 
27
-
28
- 1. Download the custom-post-type-permalinks.zip file to your computer.
29
- 1. Unzip the file.
30
- 1. Upload the `custom-post-type-permalinks` directory to your `/wp-content/plugins/` directory.
31
- 1. Activate the plugin through the 'Plugins' menu in WordPress.
32
-
33
 
34
  That's it. You can access the permalinks setting by going to *Settings -> Permalinks*.
35
 
@@ -39,26 +39,32 @@ That's it. You can access the permalinks setting by going to *Settings -> Permal
39
  * screenshot-1.png
40
 
41
 
42
- == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
 
44
- = 0.9.3.3 =
45
- * Fix Override Page Permalink Bug.
46
- * has_archive Bug Fix.
47
 
 
 
 
 
48
 
49
- = 0.9.3.2 =
50
- * wp_get_archives Bug Fix.
51
-
52
- = 0.9.3.1 =
53
- * Tested 3.6
54
- * Bug Fix.
55
-
56
-
57
- = 0.9.3 =
58
- * Admin page fix.
59
- * slngle pageing link fix.
60
- * Add Russian translation.
61
-
62
 
63
  = 0.9 =
64
  * Add custom post type archive only has_archive->true
1
  === Custom Post Type Permalinks ===
2
  Contributors: Toro_Unit
3
  Tags: permalink,permalinks,custom post type,custom taxonomy,cms
4
+ Requires at least: 3.7
5
+ Tested up to: 3.8
6
+ Stable tag: 0.9.5
7
 
8
  Lets you edit the permalink of custom post type.
9
 
10
+ == Description ==
11
 
12
  Custom Post Type Permalinks lets you edit the permalink structure of custom post type.
13
 
14
  Change custom taxonomy archive's permalink to "example.org/post_type/taxonomy_name/term_slug". Can disable this fix.
15
 
16
+ And support wp_get_archives( "post_type=foo" ).
17
+
18
  [This Plugin published on GitHub.](https://github.com/torounit/custom-post-type-permalinks)
19
 
20
  Donation: Please send amazon.co.jp Gift to donate[at]torounit.com.
21
+
22
+ = Translators =
23
+ * Japanese(ja) - [Toro_Unit](http://www.torounit.com/)
24
  * Russian(ru_RU) - [Olart](http://olart.ru)
25
 
26
 
27
  == Installation ==
28
 
29
+ * Download the custom-post-type-permalinks.zip file to your computer.
30
+ * Unzip the file.
31
+ * Upload the `custom-post-type-permalinks` directory to your `/wp-content/plugins/` directory.
32
+ * Activate the plugin through the 'Plugins' menu in WordPress.
 
 
33
 
34
  That's it. You can access the permalinks setting by going to *Settings -> Permalinks*.
35
 
39
  * screenshot-1.png
40
 
41
 
42
+ == Changelog ==
43
+
44
+ = 0.9.5 =
45
+ * Big change plugin architecture.
46
+ * Show has_archive, with_front.
47
+
48
+ = 0.9.4 =
49
+ * Internal release.
50
+
51
+ = 0.9.3.3 =
52
+ * has_archive Bug Fix.
53
+ * Fixed a bug in the link, including the extension.
54
+
55
+ = 0.9.3.2 =
56
+ * wp_get_archives Bug Fix.
57
+
58
+ = 0.9.3.1 =
59
+ * Tested 3.6
60
+ * Bug Fix.
61
 
 
 
 
62
 
63
+ = 0.9.3 =
64
+ * Admin page fix.
65
+ * slngle pageing link fix.
66
+ * Add Russian translation.
67
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
 
69
  = 0.9 =
70
  * Add custom post type archive only has_archive->true