Stars: 172
Forks: 44
Pull Requests: 36
Issues: 78
Watchers: 9
Last Updated: 2023-08-23 17:13:49
Edit the permalink of custom post type !
License: GNU General Public License v2.0
Languages: PHP, Shell, JavaScript
Contributors: Toro_Unit, inc2734, ixkaito, keita_kobayashi, strategio
Donate link: https://www.paypal.me/torounit
Tags: permalink, url, link, address, custom post type
Requires at least: 6.1
Tested up to: 6.3
Requires PHP: 7.4
License: GPLv2 or Later
License URI: http://www.gnu.org/licenses/gpl-2.0.txt
Stable tag: 3.5.2
Edit the permalink of custom post type.
Custom Post Type Permalinks allow you edit the permalink structure of custom post type.
Change custom taxonomy archive's permalink to "example.org/post_type/taxonomy_name/term_slug". Can disable this fix.
And support wp_get_archives( 'post_type=foo' ) and post type date archive (ex. example.com/post_type_slug/date/2010/01/01 ).
This Plugin published on GitHub.
Donation: Please send My Wishlist or Paypal
Example:
register_post_type( 'foo',
array(
'public' => true,
'has_archive' => true,
'rewrite' => array(
"with_front" => true
),
'cptp_permalink_structure' => '%post_id%'
)
);add_filter( 'cptp_is_rewrite_supported_by_foo', '__return_false' );
// or
add_filter( 'cptp_is_rewrite_supported', function ( $support , $post_type ) {
if ( 'foo' === $post_type ) {
return false;
}
return $support;
}, 10, 2);custom-post-type-permalinks directory to your /wp-content/plugins/ directory.That's it. You can access the permalinks setting by going to Settings -> Permalinks.
cptp_post_link_category and cptp_post_link_term .parse_request.CPTP_is_rewrite_supported_by_${post_type} and CPTP_is_rewrite_supported filter.CPTP_Module_Setting::upgrader_process_complete.CPTP_date_front.wp_list_sort .CPTP_Util::get_no_taxonomy_structure.no_taxonomy_structure default true.rewirte => false post type support.registered_post_type and registered_taxonomy action.rewrite is false.add_rewrite_rules on wp_loaded priority is changed 10 from 100. fix issue #53wp_get_post_terms by get_the_terms. fix issue #55register_uninstall_hook called twice on each page. fix issue #56CPTP_set_{$module_name}_module.wp_get_archives.cptp_post_type_link_priority, cptp_term_link_priority, cptp_attachment_link_priority.CPTP_registered_modules.register_post_type.wp_loaded action.CPTP_Module_Permalink Bug Fix.%post_id%.post_type.has_archive, with_front.has_archive Bug Fix.wp_get_archives Bug Fix.has_archive is true.wp_get_archive().%{taxonomy}% tag.%author% tag.