summaryrefslogtreecommitdiff
path: root/angebote/inc/functions.php
diff options
context:
space:
mode:
authorMax2019-02-28 14:19:09 +0100
committerMax2019-02-28 14:19:09 +0100
commit925f9a0fbbec9168737e234cf91b4f62632a60db (patch)
tree66d576a69b8e5c1a6a88f1d5ae284ef285c5a852 /angebote/inc/functions.php
parentd5f5a18aa32b80c2952ded8a5f03465741c02022 (diff)
downloadfuselkoenig_de-925f9a0fbbec9168737e234cf91b4f62632a60db.tar.gz
Fix rewrit rules of custom post type.
Diffstat (limited to 'angebote/inc/functions.php')
-rw-r--r--angebote/inc/functions.php9
1 files changed, 2 insertions, 7 deletions
diff --git a/angebote/inc/functions.php b/angebote/inc/functions.php
index 42dab03..8fda43a 100644
--- a/angebote/inc/functions.php
+++ b/angebote/inc/functions.php
@@ -62,7 +62,7 @@ function create_offer_post_type() {
),
'rewrite' => array(
#'slug' => 'aangebote/%custom-taxonomy-name%',
- 'slug' => 'angebote/%type%',
+ 'slug' => 'angebote/',
'with_front' => true,
)
)
@@ -109,12 +109,7 @@ function post_link_includes_taxonomy( $post_link, $id = 0 ){
$terms = wp_get_object_terms( $post->ID, 'type' );
file_put_contents("/tmp/wp.debug", json_encode($terms));
if( $terms ){
- # file_put_contents("/tmp/wp.debug", str_replace( 'angebote/' , 'angebote/' . $terms[0]->slug , $post_link ));
- # return $post_link;
- # return str_replace( '/angebote/' , '/angebote/' . $terms[0]->slug . '/', $post_link );
- return str_replace( '%type%' , $terms[0]->slug, $post_link );
- } else {
- return str_replace( '%type%' , '', $post_link );
+ return str_replace( 'angebote/' , 'angebote/' . $terms[0]->slug, $post_link );
}
}
return $post_link;