From 62e315d767ca1d36ce11c70b69dbf7971a0829af Mon Sep 17 00:00:00 2001 From: sect Date: Sat, 9 Dec 2023 16:50:17 +0900 Subject: [PATCH] fix: fix PHP notices --- CPTP/Module/Permalink.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CPTP/Module/Permalink.php b/CPTP/Module/Permalink.php index a6f91e0..afe6ac4 100644 --- a/CPTP/Module/Permalink.php +++ b/CPTP/Module/Permalink.php @@ -403,6 +403,10 @@ public function term_link( $termlink, $term, $taxonomy ) { return $termlink; } + if ( ! isset( $post_type_obj->rewrite['slug'] ) || ! isset( $post_type_obj->rewrite['with_front'] ) ) { + return $termlink; + } + $slug = $post_type_obj->rewrite['slug']; $with_front = $post_type_obj->rewrite['with_front'];