Custom Post Type Permalinks - Version 3.4.3

Version Description

  • Fix archive link bug fix.
Download this release

Release Info

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

Code changes from version 3.4.2 to 3.4.3

CPTP/Module/Admin.php CHANGED
@@ -147,6 +147,10 @@ class CPTP_Module_Admin extends CPTP_Module {
147
  $disabled = true;
148
  }
149
 
 
 
 
 
150
  if ( ! $value ) {
151
  $value = CPTP_DEFAULT_PERMALINK;
152
  }
@@ -159,7 +163,10 @@ class CPTP_Module_Admin extends CPTP_Module {
159
  ?>
160
  <p>
161
  <code><?php echo esc_html( home_url() . ( $slug ? '/' : '' ) . $slug ); ?></code>
162
- <input name="<?php echo esc_attr( $name ); ?>" id="<?php echo esc_attr( $name ); ?>" type="text" class="regular-text code " value="<?php echo esc_attr( $value ); ?>" <?php disabled( $disabled, true, true ); ?> />
 
 
 
163
  </p>
164
  <p>has_archive: <code><?php echo esc_html( $pt_object->has_archive ? 'true' : 'false' ); ?></code> / with_front:
165
  <code><?php echo esc_html( $pt_object->rewrite['with_front'] ? 'true' : 'false' ); ?></code></p>
147
  $disabled = true;
148
  }
149
 
150
+ if ( isset( $pt_object->cptp ) && ! empty( $pt_object->cptp['permalink_structure'] ) ) {
151
+ $disabled = true;
152
+ }
153
+
154
  if ( ! $value ) {
155
  $value = CPTP_DEFAULT_PERMALINK;
156
  }
163
  ?>
164
  <p>
165
  <code><?php echo esc_html( home_url() . ( $slug ? '/' : '' ) . $slug ); ?></code>
166
+ <input
167
+ name="<?php echo esc_attr( $name ); ?>" id="<?php echo esc_attr( $name ); ?>" type="text"
168
+ class="regular-text code "
169
+ value="<?php echo esc_attr( $value ); ?>" <?php disabled( $disabled, true, true ); ?> />
170
  </p>
171
  <p>has_archive: <code><?php echo esc_html( $pt_object->has_archive ? 'true' : 'false' ); ?></code> / with_front:
172
  <code><?php echo esc_html( $pt_object->rewrite['with_front'] ? 'true' : 'false' ); ?></code></p>
CPTP/Module/GetArchives.php CHANGED
@@ -149,6 +149,8 @@ class CPTP_Module_GetArchives extends CPTP_Module {
149
  $link_dir = $post_type->rewrite['slug'] . '/' . $c['name'] . '/' . $c['termslug'];
150
  }
151
 
 
 
152
  if ( ! strstr( $html, '/date/' ) ) {
153
  $link_dir = $link_dir . CPTP_Util::get_date_front( $post_type );
154
  }
149
  $link_dir = $post_type->rewrite['slug'] . '/' . $c['name'] . '/' . $c['termslug'];
150
  }
151
 
152
+ $ret_link = str_replace( '%link_dir%/date/', '%link_dir%/', $ret_link );
153
+
154
  if ( ! strstr( $html, '/date/' ) ) {
155
  $link_dir = $link_dir . CPTP_Util::get_date_front( $post_type );
156
  }
CPTP/Util.php CHANGED
@@ -186,7 +186,7 @@ class CPTP_Util {
186
  }
187
 
188
  if ( ! empty( $post_type->cptp ) && ! empty( $post_type->cptp['permalink_structure'] ) ) {
189
- $structure = $post_type->cptp->permalink_structure;
190
  } elseif ( ! empty( $post_type->cptp_permalink_structure ) ) {
191
  $structure = $post_type->cptp_permalink_structure;
192
  } else {
186
  }
187
 
188
  if ( ! empty( $post_type->cptp ) && ! empty( $post_type->cptp['permalink_structure'] ) ) {
189
+ $structure = $post_type->cptp['permalink_structure'];
190
  } elseif ( ! empty( $post_type->cptp_permalink_structure ) ) {
191
  $structure = $post_type->cptp_permalink_structure;
192
  } else {
custom-post-type-permalinks.php CHANGED
@@ -5,13 +5,13 @@
5
  * Description: Add post archives of custom post type and customizable permalinks.
6
  * Author: Toro_Unit
7
  * Author URI: https://torounit.com/
8
- * Version: 3.4.2
9
  * Text Domain: custom-post-type-permalinks
10
  * License: GPL2 or later
11
  * Domain Path: /language/
12
  *
13
  * @package Custom_Post_Type_Permalinks
14
- * @version 3.4.2
15
  */
16
 
17
  define( 'CPTP_PLUGIN_FILE', __FILE__ );
5
  * Description: Add post archives of custom post type and customizable permalinks.
6
  * Author: Toro_Unit
7
  * Author URI: https://torounit.com/
8
+ * Version: 3.4.3
9
  * Text Domain: custom-post-type-permalinks
10
  * License: GPL2 or later
11
  * Domain Path: /language/
12
  *
13
  * @package Custom_Post_Type_Permalinks
14
+ * @version 3.4.3
15
  */
16
 
17
  define( 'CPTP_PLUGIN_FILE', __FILE__ );
readme.txt CHANGED
@@ -8,7 +8,7 @@ Tested up to: 5.6
8
  Requires PHP: 5.6
9
  License: GPLv2 or Later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.txt
11
- Stable tag: 3.4.2
12
 
13
 
14
  Edit the permalink of custom post type.
@@ -83,6 +83,9 @@ That's it. You can access the permalinks setting by going to *Settings -> Permal
83
 
84
  == Changelog ==
85
 
 
 
 
86
  = 3.4.2 =
87
  * Tested WP 5.6.
88
 
8
  Requires PHP: 5.6
9
  License: GPLv2 or Later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.txt
11
+ Stable tag: 3.4.3
12
 
13
 
14
  Edit the permalink of custom post type.
83
 
84
  == Changelog ==
85
 
86
+ = 3.4.3 =
87
+ * Fix archive link bug fix.
88
+
89
  = 3.4.2 =
90
  * Tested WP 5.6.
91