Version Description
Download this release
Release Info
Developer | Toro_Unit |
Plugin | Custom Post Type Permalinks |
Version | 1.0.1 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.0.1
- CPTP/Module/Rewrite.php +7 -6
- custom-post-type-permalinks.php +2 -2
- readme.txt +2 -1
CPTP/Module/Rewrite.php
CHANGED
@@ -6,6 +6,7 @@
|
|
6 |
* Add Rewrite Rules
|
7 |
*
|
8 |
* @package Custom_Post_Type_Permalinks
|
|
|
9 |
* @since 0.9.4
|
10 |
*
|
11 |
* */
|
@@ -28,14 +29,14 @@ class CPTP_Module_Rewrite extends CPTP_Module {
|
|
28 |
|
29 |
public function add_rewrite_rules() {
|
30 |
|
31 |
-
foreach ( $this->post_type_args as $args ) {
|
32 |
-
call_user_func_array( array( $this, 'register_post_type_rules' ), $args );
|
33 |
-
}
|
34 |
-
|
35 |
foreach ( $this->taxonomy_args as $args ) {
|
36 |
call_user_func_array( array( $this, 'register_taxonomy_rules' ), $args );
|
37 |
}
|
38 |
|
|
|
|
|
|
|
|
|
39 |
}
|
40 |
|
41 |
/**
|
@@ -137,8 +138,8 @@ class CPTP_Module_Rewrite extends CPTP_Module {
|
|
137 |
add_rewrite_rule( $slug . $date_front . '/([0-9]{4})/?$', 'index.php?year=$matches[1]&post_type=' . $post_type, 'top' );
|
138 |
add_rewrite_rule( $slug . '/author/([^/]+)/page/?([0-9]{1,})/?$', 'index.php?author_name=$matches[1]&paged=$matches[2]&post_type=' . $post_type, 'top' );
|
139 |
add_rewrite_rule( $slug . '/author/([^/]+)/?$', 'index.php?author_name=$matches[1]&post_type=' . $post_type, 'top' );
|
140 |
-
add_rewrite_rule( $slug .
|
141 |
-
add_rewrite_rule( $slug .
|
142 |
|
143 |
do_action( 'CPTP_registered_' . $post_type . '_rules', $args, $slug );
|
144 |
}
|
6 |
* Add Rewrite Rules
|
7 |
*
|
8 |
* @package Custom_Post_Type_Permalinks
|
9 |
+
* @version 1.0.1
|
10 |
* @since 0.9.4
|
11 |
*
|
12 |
* */
|
29 |
|
30 |
public function add_rewrite_rules() {
|
31 |
|
|
|
|
|
|
|
|
|
32 |
foreach ( $this->taxonomy_args as $args ) {
|
33 |
call_user_func_array( array( $this, 'register_taxonomy_rules' ), $args );
|
34 |
}
|
35 |
|
36 |
+
foreach ( $this->post_type_args as $args ) {
|
37 |
+
call_user_func_array( array( $this, 'register_post_type_rules' ), $args );
|
38 |
+
}
|
39 |
+
|
40 |
}
|
41 |
|
42 |
/**
|
138 |
add_rewrite_rule( $slug . $date_front . '/([0-9]{4})/?$', 'index.php?year=$matches[1]&post_type=' . $post_type, 'top' );
|
139 |
add_rewrite_rule( $slug . '/author/([^/]+)/page/?([0-9]{1,})/?$', 'index.php?author_name=$matches[1]&paged=$matches[2]&post_type=' . $post_type, 'top' );
|
140 |
add_rewrite_rule( $slug . '/author/([^/]+)/?$', 'index.php?author_name=$matches[1]&post_type=' . $post_type, 'top' );
|
141 |
+
add_rewrite_rule( $slug . get_option( 'category_base' ) . '/([^/]+)/page/?([0-9]{1,})/?$', 'index.php?category_name=$matches[1]&paged=$matches[2]&post_type=' . $post_type, 'top' );
|
142 |
+
add_rewrite_rule( $slug . get_option( 'category_base' ) . '/([^/]+)/?$', 'index.php?category_name=$matches[1]&post_type=' . $post_type, 'top' );
|
143 |
|
144 |
do_action( 'CPTP_registered_' . $post_type . '_rules', $args, $slug );
|
145 |
}
|
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: 1.0.
|
9 |
Text Domain: cptp
|
10 |
License: GPL2 or later
|
11 |
Domain Path: /language/
|
@@ -22,7 +22,7 @@ Domain Path: /language/
|
|
22 |
*/
|
23 |
|
24 |
define( 'CPTP_PLUGIN_FILE', __FILE__ );
|
25 |
-
define( 'CPTP_VERSION', '1.0.
|
26 |
define( 'CPTP_DEFAULT_PERMALINK', '/%postname%/' );
|
27 |
|
28 |
|
5 |
Description: Add post archives of custom post type and customizable permalinks.
|
6 |
Author: Toro_Unit
|
7 |
Author URI: http://www.torounit.com/plugins/custom-post-type-permalinks/
|
8 |
+
Version: 1.0.1
|
9 |
Text Domain: cptp
|
10 |
License: GPL2 or later
|
11 |
Domain Path: /language/
|
22 |
*/
|
23 |
|
24 |
define( 'CPTP_PLUGIN_FILE', __FILE__ );
|
25 |
+
define( 'CPTP_VERSION', '1.0.1' );
|
26 |
define( 'CPTP_DEFAULT_PERMALINK', '/%postname%/' );
|
27 |
|
28 |
|
readme.txt
CHANGED
@@ -4,7 +4,8 @@ Donate link: http://www.amazon.co.jp/registry/wishlist/COKSXS25MVQV
|
|
4 |
Tags: permalink,permalinks,custom post type,custom taxonomy,cms
|
5 |
Requires at least: 4.1
|
6 |
Tested up to: 4.2
|
7 |
-
Stable tag: 1.0.
|
|
|
8 |
|
9 |
Lets you edit the permalink of custom post type.
|
10 |
|
4 |
Tags: permalink,permalinks,custom post type,custom taxonomy,cms
|
5 |
Requires at least: 4.1
|
6 |
Tested up to: 4.2
|
7 |
+
Stable tag: 1.0.1
|
8 |
+
License: GPLv2 or Later
|
9 |
|
10 |
Lets you edit the permalink of custom post type.
|
11 |
|