Skip to content

Commit d1d1788

Browse files
author
Frederic Fauvel
authored
Merge branch 'master' into wpml-slug-translation-fix
2 parents cb5cdd7 + 864b6e9 commit d1d1788

File tree

7 files changed

+25
-14
lines changed

7 files changed

+25
-14
lines changed

CPTP/Module/Admin.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ public function setting_structure_callback_function( $option ) {
147147
$disabled = true;
148148
}
149149

150+
if ( isset( $pt_object->cptp ) && ! empty( $pt_object->cptp['permalink_structure'] ) ) {
151+
$disabled = true;
152+
}
153+
150154
if ( ! $value ) {
151155
$value = CPTP_DEFAULT_PERMALINK;
152156
}
@@ -159,7 +163,10 @@ public function setting_structure_callback_function( $option ) {
159163
?>
160164
<p>
161165
<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 ); ?> />
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 ); ?> />
163170
</p>
164171
<p>has_archive: <code><?php echo esc_html( $pt_object->has_archive ? 'true' : 'false' ); ?></code> / with_front:
165172
<code><?php echo esc_html( $pt_object->rewrite['with_front'] ? 'true' : 'false' ); ?></code></p>

CPTP/Module/GetArchives.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ public function get_archives_link( $html ) {
149149
$link_dir = $post_type->rewrite['slug'] . '/' . $c['name'] . '/' . $c['termslug'];
150150
}
151151

152+
$ret_link = str_replace( '%link_dir%/date/', '%link_dir%/', $ret_link );
153+
152154
if ( ! strstr( $html, '/date/' ) ) {
153155
$link_dir = $link_dir . CPTP_Util::get_date_front( $post_type );
154156
}

CPTP/Util.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public static function get_permalink_structure( $post_type ) {
186186
}
187187

188188
if ( ! empty( $post_type->cptp ) && ! empty( $post_type->cptp['permalink_structure'] ) ) {
189-
$structure = $post_type->cptp->permalink_structure;
189+
$structure = $post_type->cptp['permalink_structure'];
190190
} elseif ( ! empty( $post_type->cptp_permalink_structure ) ) {
191191
$structure = $post_type->cptp_permalink_structure;
192192
} else {

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,18 @@ Tested up to: 5.6
88
Requires PHP: 5.6
99
License: GPLv2 or Later
1010
License URI: http://www.gnu.org/licenses/gpl-2.0.txt
11-
Stable tag: 3.4.2
11+
Stable tag: 3.4.3
1212

1313

1414
Edit the permalink of custom post type.
1515

1616
<!-- only:github/ -->
17-
[![Latest Stable Version](https://poser.pugx.org/torounit/custom-post-type-permalinks/v/stable)](https://packagist.org/packages/torounit/custom-post-type-permalinks)
18-
[![License](https://poser.pugx.org/torounit/custom-post-type-permalinks/license)](https://packagist.org/packages/torounit/custom-post-type-permalinks)
19-
[![Downloads](https://img.shields.io/wordpress/plugin/dt/custom-post-type-permalinks.svg)](https://wordpress.org/plugins/custom-post-type-permalinks/)
20-
[![Tested up](https://img.shields.io/wordpress/v/custom-post-type-permalinks.svg)](https://wordpress.org/plugins/custom-post-type-permalinks/)
21-
[![wp.org rating](https://img.shields.io/wordpress/plugin/r/custom-post-type-permalinks.svg)](https://wordpress.org/plugins/custom-post-type-permalinks/)
22-
[![Build Status](https://travis-ci.org/torounit/custom-post-type-permalinks.svg)](https://travis-ci.org/torounit/custom-post-type-permalinks)
23-
[![Donation](https://img.shields.io/badge/bitcoin-donate-yellow.svg)](https://blockchain.info/ja/address/3HwkojX2pd9wc5kPFdXnDXMTNbgBmPRygX)
17+
[![Latest Stable Version](https://img.shields.io/wordpress/plugin/v/custom-post-type-permalinks?style=for-the-badge)](https://wordpress.org/plugins/custom-post-type-permalinks/)
18+
[![License](https://img.shields.io/github/license/torounit/custom-post-type-permalinks?style=for-the-badge)](https://github.com/torounit/custom-post-type-permalinks/blob/master/LICENSE)
19+
[![Downloads](https://img.shields.io/wordpress/plugin/dt/custom-post-type-permalinks.svg?style=for-the-badge)](https://wordpress.org/plugins/custom-post-type-permalinks/)
20+
[![Tested up](https://img.shields.io/wordpress/v/custom-post-type-permalinks.svg?style=for-the-badge)](https://wordpress.org/plugins/custom-post-type-permalinks/)
21+
[![wp.org rating](https://img.shields.io/wordpress/plugin/r/custom-post-type-permalinks.svg?style=for-the-badge)](https://wordpress.org/plugins/custom-post-type-permalinks/)
22+
[![Build Status](https://img.shields.io/github/workflow/status/torounit/custom-post-type-permalinks/Test?style=for-the-badge)](https://github.com/torounit/custom-post-type-permalinks/actions)
2423
[![](https://ps.w.org/custom-post-type-permalinks/assets/banner-1544x500.png?rev=1044335)](https://wordpress.org/plugins/custom-post-type-permalinks/)
2524
<!-- /only:github -->
2625

@@ -96,6 +95,9 @@ That's it. You can access the permalinks setting by going to *Settings -> Permal
9695

9796
## Changelog
9897

98+
### 3.4.3
99+
* Fix archive link bug fix.
100+
99101
### 3.4.2
100102
* Tested WP 5.6.
101103

custom-post-type-permalinks.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
* Description: Add post archives of custom post type and customizable permalinks.
66
* Author: Toro_Unit
77
* Author URI: https://torounit.com/
8-
* Version: 3.4.2
8+
* Version: 3.4.3
99
* Text Domain: custom-post-type-permalinks
1010
* License: GPL2 or later
1111
* Domain Path: /language/
1212
*
1313
* @package Custom_Post_Type_Permalinks
14-
* @version 3.4.2
14+
* @version 3.4.3
1515
*/
1616

1717
define( 'CPTP_PLUGIN_FILE', __FILE__ );

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "custom-post-type-permalinks",
3-
"version": "3.4.2",
3+
"version": "3.4.3",
44
"description": "Custom Post Type Permalinks allow you edit the permalink structure of custom post type.",
55
"private": true,
66
"directories": {

0 commit comments

Comments
 (0)