Version Description
- Paging Bug Fix.
- Commnent Paging.
- Show pointer. *
Download this release
Release Info
Developer | Toro_Unit |
Plugin | Custom Post Type Permalinks |
Version | 0.8.6 |
Comparing to | |
See all releases |
Code changes from version 0.8.1 to 0.8.6
- cptp-ja.mo +0 -0
- cptp-ja.po +35 -22
- custom-post-type-permalinks.php +111 -26
- readme.txt +9 -2
cptp-ja.mo
CHANGED
Binary file
|
cptp-ja.po
CHANGED
@@ -2,53 +2,66 @@ msgid ""
|
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Custom Post Type Permalinks\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
-
"POT-Creation-Date: 2012-
|
6 |
-
"PO-Revision-Date: 2012-
|
7 |
"Last-Translator: Toro_Unit <mail@torounit.com>\n"
|
8 |
"Language-Team: Toro_Unit <mail@torounit.com>\n"
|
|
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
"X-Poedit-KeywordsList: _;gettext;gettext_noop;_e;__\n"
|
13 |
-
"X-Poedit-Basepath: C:\\Users\\Toro-Unit\\Documents\\Develop\\custom-post-
|
14 |
-
"
|
15 |
-
"X-
|
16 |
"X-Poedit-SearchPath-0: custom-post-type-permalinks\n"
|
17 |
|
18 |
-
#: custom-post-type-permalinks/custom-post-type-permalinks.php:
|
19 |
#, php-format
|
20 |
msgid "View all posts in %s"
|
21 |
-
msgstr ""
|
22 |
|
23 |
-
#: custom-post-type-permalinks/custom-post-type-permalinks.php:
|
24 |
msgid "Permalink Setting for custom post type"
|
25 |
msgstr "カスタム投稿タイプのパーマリンクの設定"
|
26 |
|
27 |
-
#: custom-post-type-permalinks/custom-post-type-permalinks.php:
|
28 |
msgid "Use custom permalink of custom taxonomy archive."
|
29 |
msgstr "カスタム分類のアーカイブのパーマリンクを変更する。"
|
30 |
|
31 |
-
#: custom-post-type-permalinks/custom-post-type-permalinks.php:
|
32 |
msgid "Setting permalinks of custom post type."
|
33 |
msgstr "カスタム投稿タイプごとのパーマリンク構造を設定できます。"
|
34 |
|
35 |
-
#: custom-post-type-permalinks/custom-post-type-permalinks.php:
|
36 |
-
msgid "
|
37 |
-
|
|
|
|
|
|
|
|
|
38 |
|
39 |
-
#: custom-post-type-permalinks/custom-post-type-permalinks.php:
|
40 |
msgid "%\"custom_taxonomy_slug\"% is replaced the taxonomy's term.'."
|
41 |
msgstr "'%\"カスタム分類名\"%' は、そのカスタム分類のタームに置換されます。"
|
42 |
|
43 |
-
#: custom-post-type-permalinks/custom-post-type-permalinks.php:
|
44 |
-
msgid "
|
|
|
|
|
45 |
msgstr "末尾の '/' の有無は、標準のパーマリンク構造の設定に統一されます。"
|
46 |
|
47 |
-
#: custom-post-type-permalinks/custom-post-type-permalinks.php:
|
48 |
-
msgid "
|
|
|
|
|
49 |
msgstr "未入力のときは、/%postname%/ に設定されます。"
|
50 |
|
51 |
-
#: custom-post-type-permalinks/custom-post-type-permalinks.php:
|
52 |
-
|
53 |
-
|
54 |
-
|
|
|
|
|
|
|
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Custom Post Type Permalinks\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2012-11-23 23:07+0900\n"
|
6 |
+
"PO-Revision-Date: 2012-11-23 23:12+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"
|
10 |
"MIME-Version: 1.0\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: 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:89
|
20 |
#, php-format
|
21 |
msgid "View all posts in %s"
|
22 |
+
msgstr "%s のすべての投稿を見る"
|
23 |
|
24 |
+
#: custom-post-type-permalinks/custom-post-type-permalinks.php:505
|
25 |
msgid "Permalink Setting for custom post type"
|
26 |
msgstr "カスタム投稿タイプのパーマリンクの設定"
|
27 |
|
28 |
+
#: custom-post-type-permalinks/custom-post-type-permalinks.php:547
|
29 |
msgid "Use custom permalink of custom taxonomy archive."
|
30 |
msgstr "カスタム分類のアーカイブのパーマリンクを変更する。"
|
31 |
|
32 |
+
#: custom-post-type-permalinks/custom-post-type-permalinks.php:568
|
33 |
msgid "Setting permalinks of custom post type."
|
34 |
msgstr "カスタム投稿タイプごとのパーマリンク構造を設定できます。"
|
35 |
|
36 |
+
#: custom-post-type-permalinks/custom-post-type-permalinks.php:569
|
37 |
+
msgid ""
|
38 |
+
"The tags you can use is WordPress Structure Tags and '%\"custom_taxonomy_slug"
|
39 |
+
"\"%'. (e.g. %actors%)"
|
40 |
+
msgstr ""
|
41 |
+
"使用できるタグは、WordPress標準のタグと '%\"カスタム分類名\"%' です。 (例: "
|
42 |
+
"%actors%)"
|
43 |
|
44 |
+
#: custom-post-type-permalinks/custom-post-type-permalinks.php:570
|
45 |
msgid "%\"custom_taxonomy_slug\"% is replaced the taxonomy's term.'."
|
46 |
msgstr "'%\"カスタム分類名\"%' は、そのカスタム分類のタームに置換されます。"
|
47 |
|
48 |
+
#: custom-post-type-permalinks/custom-post-type-permalinks.php:572
|
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:573
|
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:593
|
61 |
+
#, php-format
|
62 |
+
msgid ""
|
63 |
+
"If you check,The custom taxonomy's permalinks is <code>%s/post_type/taxonomy/"
|
64 |
+
"term</code>."
|
65 |
+
msgstr ""
|
66 |
+
"チェックした場合、カスタム分類のアーカイブのパーマリンクは <code>%s/"
|
67 |
+
"post_type/taxonomy/term</code>. に変更されます。"
|
custom-post-type-permalinks.php
CHANGED
@@ -5,7 +5,7 @@ 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.8.
|
9 |
Text Domain: cptp
|
10 |
Domain Path: /
|
11 |
*/
|
@@ -47,7 +47,7 @@ class Custom_Post_Type_Permalinks {
|
|
47 |
* @version 2.0
|
48 |
*/
|
49 |
|
50 |
-
public function
|
51 |
add_action('wp_loaded',array(&$this,'set_archive_rewrite'),99);
|
52 |
add_action('wp_loaded', array(&$this,'set_rewrite'),100);
|
53 |
add_action('wp_loaded', array(&$this,'add_tax_rewrite'));
|
@@ -127,7 +127,7 @@ class Custom_Post_Type_Permalinks {
|
|
127 |
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' );
|
128 |
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' );
|
129 |
add_rewrite_rule( $slug.'/date/([0-9]{4})/?$', 'index.php?year=$matches[1]&post_type='.$post_type, 'top' );
|
130 |
-
add_rewrite_rule( $slug.'/author/([^/]+)/?$', 'index.php?
|
131 |
add_rewrite_rule( $slug.'/page/?([0-9]{1,})/?$', 'index.php?paged=$matches[1]&post_type='.$post_type, 'top' );
|
132 |
add_rewrite_rule( $slug.'/?$', 'index.php?post_type='.$post_type, 'top' );
|
133 |
|
@@ -139,7 +139,8 @@ class Custom_Post_Type_Permalinks {
|
|
139 |
/**
|
140 |
*
|
141 |
* Add Rewrite rule for single posts.
|
142 |
-
* @version
|
|
|
143 |
*
|
144 |
*/
|
145 |
public function set_rewrite() {
|
@@ -161,15 +162,29 @@ class Custom_Post_Type_Permalinks {
|
|
161 |
$slug = $post_type;
|
162 |
|
163 |
$permalink = '/'.$slug.'/'.$permalink;
|
164 |
-
|
|
|
|
|
|
|
|
|
165 |
$permalink = str_replace( '//', '/', $permalink );
|
166 |
|
167 |
$wp_rewrite->add_rewrite_tag( '%post_type%', '([^/]+)', 'post_type=' );
|
168 |
$wp_rewrite->add_rewrite_tag( '%'.$post_type.'_id%', '([0-9]{1,})','post_type='.$post_type.'&p=' );
|
169 |
$wp_rewrite->add_rewrite_tag( '%'.$post_type.'_page%', '([0-9]{1,}?)',"page=" );
|
170 |
|
171 |
-
$
|
172 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
endforeach;
|
174 |
|
175 |
$taxonomies = get_taxonomies( array("show_ui" => true, "_builtin" => false), 'objects' );
|
@@ -183,10 +198,15 @@ class Custom_Post_Type_Permalinks {
|
|
183 |
/**
|
184 |
*
|
185 |
* Fix permalinks output.
|
186 |
-
*
|
|
|
|
|
|
|
|
|
|
|
187 |
*
|
188 |
*/
|
189 |
-
public function set_permalink( $post_link, $post
|
190 |
global $wp_rewrite;
|
191 |
$draft_or_pending = isset( $post->post_status ) && in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft' ) );
|
192 |
if( $draft_or_pending and !$leavename )
|
@@ -201,10 +221,12 @@ class Custom_Post_Type_Permalinks {
|
|
201 |
$permalink = str_replace( '%'.$post_type.'_cpage%', "", $permalink );
|
202 |
|
203 |
$parentsDirs = "";
|
204 |
-
|
205 |
-
|
206 |
-
$
|
207 |
-
|
|
|
|
|
208 |
}
|
209 |
|
210 |
$permalink = str_replace( '%'.$post_type.'%', $parentsDirs.'%'.$post_type.'%', $permalink );
|
@@ -246,9 +268,9 @@ class Custom_Post_Type_Permalinks {
|
|
246 |
|
247 |
$permalink = str_replace('//', "/", $permalink );
|
248 |
|
249 |
-
$permalink = home_url( user_trailingslashit( $permalink ) );
|
250 |
-
|
251 |
-
return $permalink = str_replace($str, "", $permalink );
|
252 |
|
253 |
}
|
254 |
|
@@ -307,14 +329,15 @@ class Custom_Post_Type_Permalinks {
|
|
307 |
$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]
|
308 |
|
309 |
if (isset($this->get_archives_where_r['post_type']) and $this->get_archives_where_r['type'] != 'postbypost'){
|
310 |
-
$blog_url = get_bloginfo("url");
|
|
|
|
|
|
|
311 |
|
312 |
-
// /archive/%post_id%
|
313 |
-
$str = rtrim( preg_replace("/\.[a-z,_]*/","",get_option("permalink_structure")) ,'');
|
314 |
-
if($str = rtrim( preg_replace("/%[a-z,_]*%/","",$str) ,'/')) {
|
315 |
$ret_link = str_replace($str, '/'.'%link_dir%', $link);
|
316 |
}else{
|
317 |
-
$blog_url =
|
318 |
$ret_link = str_replace($blog_url,$blog_url.'/'.'%link_dir%',$link);
|
319 |
}
|
320 |
|
@@ -436,10 +459,12 @@ class Custom_Post_Type_Permalinks {
|
|
436 |
|
437 |
class Custom_Post_Type_Permalinks_Admin {
|
438 |
|
439 |
-
public function
|
440 |
add_action('init', array(&$this,'load_textdomain'));
|
441 |
add_action('init', array(&$this, 'update_rules'));
|
442 |
add_action('admin_init', array(&$this,'settings_api_init'),30);
|
|
|
|
|
443 |
}
|
444 |
|
445 |
public function load_textdomain() {
|
@@ -480,7 +505,12 @@ class Custom_Post_Type_Permalinks_Admin {
|
|
480 |
}
|
481 |
|
482 |
|
483 |
-
|
|
|
|
|
|
|
|
|
|
|
484 |
public function settings_api_init() {
|
485 |
add_settings_section('cptp_setting_section',
|
486 |
__("Permalink Setting for custom post type",'cptp'),
|
@@ -550,7 +580,7 @@ class Custom_Post_Type_Permalinks_Admin {
|
|
550 |
<?php _e("The tags you can use is WordPress Structure Tags and '%\"custom_taxonomy_slug\"%'. (e.g. %actors%)",'cptp');?><br />
|
551 |
<?php _e("%\"custom_taxonomy_slug\"% is replaced the taxonomy's term.'.",'cptp');?></p>
|
552 |
|
553 |
-
<p><?php _e("Presence of the trailing '/' is unified into a standard permalink structure setting.",'cptp')
|
554 |
<?php _e("If you don't entered permalink structure, permalink is configured /%postname%/'.",'cptp');?>
|
555 |
</p>
|
556 |
<?php
|
@@ -562,14 +592,69 @@ class Custom_Post_Type_Permalinks_Admin {
|
|
562 |
if( !$slug )
|
563 |
$slug = $post_type;
|
564 |
|
565 |
-
|
|
|
|
|
|
|
|
|
566 |
}
|
567 |
|
568 |
public function setting_no_tax_structure_callback_function(){
|
569 |
echo '<input name="no_taxonomy_structure" id="no_taxonomy_structure" type="checkbox" value="1" class="code" ' . checked( false, get_option('no_taxonomy_structure'),false) . ' /> ';
|
570 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
571 |
}
|
572 |
}
|
573 |
|
574 |
$custom_post_type_permalinks = new Custom_Post_Type_Permalinks;
|
|
|
|
|
|
|
575 |
$custom_post_type_permalinks_admin = new Custom_Post_Type_Permalinks_Admin;
|
|
|
|
|
|
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.8.6
|
9 |
Text Domain: cptp
|
10 |
Domain Path: /
|
11 |
*/
|
47 |
* @version 2.0
|
48 |
*/
|
49 |
|
50 |
+
public function add_hook () {
|
51 |
add_action('wp_loaded',array(&$this,'set_archive_rewrite'),99);
|
52 |
add_action('wp_loaded', array(&$this,'set_rewrite'),100);
|
53 |
add_action('wp_loaded', array(&$this,'add_tax_rewrite'));
|
127 |
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' );
|
128 |
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' );
|
129 |
add_rewrite_rule( $slug.'/date/([0-9]{4})/?$', 'index.php?year=$matches[1]&post_type='.$post_type, 'top' );
|
130 |
+
add_rewrite_rule( $slug.'/author/([^/]+)/?$', 'index.php?author_name=$matches[1]&post_type='.$post_type, 'top' );
|
131 |
add_rewrite_rule( $slug.'/page/?([0-9]{1,})/?$', 'index.php?paged=$matches[1]&post_type='.$post_type, 'top' );
|
132 |
add_rewrite_rule( $slug.'/?$', 'index.php?post_type='.$post_type, 'top' );
|
133 |
|
139 |
/**
|
140 |
*
|
141 |
* Add Rewrite rule for single posts.
|
142 |
+
* @version 2.0
|
143 |
+
*
|
144 |
*
|
145 |
*/
|
146 |
public function set_rewrite() {
|
162 |
$slug = $post_type;
|
163 |
|
164 |
$permalink = '/'.$slug.'/'.$permalink;
|
165 |
+
|
166 |
+
if( strpos( $permalink , '%'.$post_type.'%' ) === false ) {
|
167 |
+
$permalink = $permalink.'/%'.$post_type.'_page%';
|
168 |
+
}
|
169 |
+
|
170 |
$permalink = str_replace( '//', '/', $permalink );
|
171 |
|
172 |
$wp_rewrite->add_rewrite_tag( '%post_type%', '([^/]+)', 'post_type=' );
|
173 |
$wp_rewrite->add_rewrite_tag( '%'.$post_type.'_id%', '([0-9]{1,})','post_type='.$post_type.'&p=' );
|
174 |
$wp_rewrite->add_rewrite_tag( '%'.$post_type.'_page%', '([0-9]{1,}?)',"page=" );
|
175 |
|
176 |
+
$param = array(
|
177 |
+
'with_front' => false,
|
178 |
+
'ep_mask' => EP_ALL,
|
179 |
+
'paged' => true,
|
180 |
+
'feed' => true,
|
181 |
+
'forcomments' => true,
|
182 |
+
'walk_dirs' => true,
|
183 |
+
'endpoints' => true,
|
184 |
+
);
|
185 |
+
|
186 |
+
//$wp_rewrite->generate_rewrite_rules( $permalink, EP_NONE, true, true, true,true);
|
187 |
+
$wp_rewrite->add_permastruct( $post_type, $permalink, $param );
|
188 |
endforeach;
|
189 |
|
190 |
$taxonomies = get_taxonomies( array("show_ui" => true, "_builtin" => false), 'objects' );
|
198 |
/**
|
199 |
*
|
200 |
* Fix permalinks output.
|
201 |
+
*
|
202 |
+
* @param String $post_link
|
203 |
+
* @param Object $post 投稿情報
|
204 |
+
* @param String $leavename 記事編集画面でのみ渡される
|
205 |
+
*
|
206 |
+
* @version 1.2
|
207 |
*
|
208 |
*/
|
209 |
+
public function set_permalink( $post_link, $post, $leavename ) {
|
210 |
global $wp_rewrite;
|
211 |
$draft_or_pending = isset( $post->post_status ) && in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft' ) );
|
212 |
if( $draft_or_pending and !$leavename )
|
221 |
$permalink = str_replace( '%'.$post_type.'_cpage%', "", $permalink );
|
222 |
|
223 |
$parentsDirs = "";
|
224 |
+
if( !$leavename ){
|
225 |
+
$postId = $post->ID;
|
226 |
+
while ($parent = get_post($postId)->post_parent) {
|
227 |
+
$parentsDirs = get_post($parent)->post_name."/".$parentsDirs;
|
228 |
+
$postId = $parent;
|
229 |
+
}
|
230 |
}
|
231 |
|
232 |
$permalink = str_replace( '%'.$post_type.'%', $parentsDirs.'%'.$post_type.'%', $permalink );
|
268 |
|
269 |
$permalink = str_replace('//', "/", $permalink );
|
270 |
|
271 |
+
return $permalink = home_url( user_trailingslashit( $permalink ) );
|
272 |
+
//$str = rtrim( preg_replace("/%[a-z,_]*%/","",get_option("permalink_structure")) ,'/');
|
273 |
+
//return $permalink = str_replace($str, "", $permalink );
|
274 |
|
275 |
}
|
276 |
|
329 |
$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]
|
330 |
|
331 |
if (isset($this->get_archives_where_r['post_type']) and $this->get_archives_where_r['type'] != 'postbypost'){
|
332 |
+
$blog_url = rtrim( get_bloginfo("url") ,'/');
|
333 |
+
|
334 |
+
//remove .ext
|
335 |
+
$str = preg_replace("/\.[a-z,_]*/","",get_option("permalink_structure"));
|
336 |
|
337 |
+
if($str = rtrim( preg_replace("/%[a-z,_]*%/","",$str) ,'/')) { // /archive/%post_id%
|
|
|
|
|
338 |
$ret_link = str_replace($str, '/'.'%link_dir%', $link);
|
339 |
}else{
|
340 |
+
$blog_url = preg_replace('/https?:\/\//', '', $blog_url);
|
341 |
$ret_link = str_replace($blog_url,$blog_url.'/'.'%link_dir%',$link);
|
342 |
}
|
343 |
|
459 |
|
460 |
class Custom_Post_Type_Permalinks_Admin {
|
461 |
|
462 |
+
public function add_hook () {
|
463 |
add_action('init', array(&$this,'load_textdomain'));
|
464 |
add_action('init', array(&$this, 'update_rules'));
|
465 |
add_action('admin_init', array(&$this,'settings_api_init'),30);
|
466 |
+
add_action('admin_enqueue_scripts', array(&$this,'enqueue_css_js'));
|
467 |
+
add_action('admin_footer',array(&$this,'pointer_js'));
|
468 |
}
|
469 |
|
470 |
public function load_textdomain() {
|
505 |
}
|
506 |
|
507 |
|
508 |
+
/**
|
509 |
+
*
|
510 |
+
* Setting Init
|
511 |
+
* @since 0.7
|
512 |
+
*
|
513 |
+
*/
|
514 |
public function settings_api_init() {
|
515 |
add_settings_section('cptp_setting_section',
|
516 |
__("Permalink Setting for custom post type",'cptp'),
|
580 |
<?php _e("The tags you can use is WordPress Structure Tags and '%\"custom_taxonomy_slug\"%'. (e.g. %actors%)",'cptp');?><br />
|
581 |
<?php _e("%\"custom_taxonomy_slug\"% is replaced the taxonomy's term.'.",'cptp');?></p>
|
582 |
|
583 |
+
<p><?php _e("Presence of the trailing '/' is unified into a standard permalink structure setting.",'cptp');?>
|
584 |
<?php _e("If you don't entered permalink structure, permalink is configured /%postname%/'.",'cptp');?>
|
585 |
</p>
|
586 |
<?php
|
592 |
if( !$slug )
|
593 |
$slug = $post_type;
|
594 |
|
595 |
+
$value = get_option($option);
|
596 |
+
if( !$value )
|
597 |
+
$value = Custom_Post_Type_Permalinks::$default_structure;
|
598 |
+
|
599 |
+
echo '<code>'.home_url().'/'.$slug.'</code> <input name="'.$option.'" id="'.$option.'" type="text" class="regular-text code" value="' . $value .'" />';
|
600 |
}
|
601 |
|
602 |
public function setting_no_tax_structure_callback_function(){
|
603 |
echo '<input name="no_taxonomy_structure" id="no_taxonomy_structure" type="checkbox" value="1" class="code" ' . checked( false, get_option('no_taxonomy_structure'),false) . ' /> ';
|
604 |
+
$txt = __("If you check,The custom taxonomy's permalinks is <code>%s/post_type/taxonomy/term</code>.","cptp");
|
605 |
+
printf($txt , home_url());
|
606 |
+
}
|
607 |
+
|
608 |
+
|
609 |
+
/**
|
610 |
+
*
|
611 |
+
* enqueue CSS and JS
|
612 |
+
* @since 0.8.5
|
613 |
+
*
|
614 |
+
*/
|
615 |
+
public function enqueue_css_js() {
|
616 |
+
wp_enqueue_style('wp-pointer');
|
617 |
+
wp_enqueue_script('wp-pointer');
|
618 |
+
}
|
619 |
+
|
620 |
+
|
621 |
+
/**
|
622 |
+
*
|
623 |
+
* add js for pointer
|
624 |
+
* @since 0.8.5
|
625 |
+
*/
|
626 |
+
public function pointer_js() {
|
627 |
+
if(!is_network_admin()) {
|
628 |
+
$dismissed = explode(',', get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ));
|
629 |
+
if(array_search('cptp_pointer085', $dismissed) === false){
|
630 |
+
?>
|
631 |
+
<script type="text/javascript">
|
632 |
+
jQuery(function($) {
|
633 |
+
|
634 |
+
$("#menu-settings .wp-has-submenu").pointer({
|
635 |
+
content: "<h3>Custom Post Type Permalinks</h3><p><a href='options-permalink.php'>パーマリンク設定</a>より、カスタム投稿タイプごとのパーマリンクを設定できます。</p>",
|
636 |
+
position: {"edge":"left","align":"center"},
|
637 |
+
close: function() {
|
638 |
+
$.post('admin-ajax.php', {
|
639 |
+
action:'dismiss-wp-pointer',
|
640 |
+
pointer: 'cptp_pointer085'
|
641 |
+
})
|
642 |
+
|
643 |
+
}
|
644 |
+
}).pointer("open");
|
645 |
+
});
|
646 |
+
</script>
|
647 |
+
<?php
|
648 |
+
}
|
649 |
+
}
|
650 |
}
|
651 |
}
|
652 |
|
653 |
$custom_post_type_permalinks = new Custom_Post_Type_Permalinks;
|
654 |
+
$custom_post_type_permalinks = apply_filters('custom_post_type_permalinks', $custom_post_type_permalinks);
|
655 |
+
$custom_post_type_permalinks->add_hook();
|
656 |
+
|
657 |
$custom_post_type_permalinks_admin = new Custom_Post_Type_Permalinks_Admin;
|
658 |
+
$custom_post_type_permalinks_admin = apply_filters('custom_post_type_permalinks_admin', $custom_post_type_permalinks_admin);
|
659 |
+
$custom_post_type_permalinks_admin->add_hook();
|
660 |
+
?>
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: Toro_Unit
|
3 |
Tags: custom post type,permalink
|
4 |
Requires at least: 3.4
|
5 |
-
Tested up to: 3.
|
6 |
-
Stable tag: 0.8.
|
7 |
|
8 |
Lets you edit the permalink of custom post type.
|
9 |
|
@@ -32,6 +32,13 @@ That's it. You can access the permalinks setting by going to *Settings -> Permal
|
|
32 |
|
33 |
== Changelog ==
|
34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
= 0.8.1 =
|
36 |
* Bug Fix.
|
37 |
|
2 |
Contributors: Toro_Unit
|
3 |
Tags: custom post type,permalink
|
4 |
Requires at least: 3.4
|
5 |
+
Tested up to: 3.5
|
6 |
+
Stable tag: 0.8.6
|
7 |
|
8 |
Lets you edit the permalink of custom post type.
|
9 |
|
32 |
|
33 |
== Changelog ==
|
34 |
|
35 |
+
|
36 |
+
= 0.8.6 =
|
37 |
+
* Paging Bug Fix.
|
38 |
+
* Commnent Paging.
|
39 |
+
* Show pointer.
|
40 |
+
*
|
41 |
+
|
42 |
= 0.8.1 =
|
43 |
* Bug Fix.
|
44 |
|