From 8cc6c2279e77004740ea5b4beefffd03051e4d7d Mon Sep 17 00:00:00 2001 From: jorge-vitrubio Date: Wed, 28 Dec 2022 19:12:18 +0100 Subject: [PATCH] changes custom post type label to mid slash --- includes/custom-post-type-ajuts.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/includes/custom-post-type-ajuts.php b/includes/custom-post-type-ajuts.php index bba3977..b308b15 100644 --- a/includes/custom-post-type-ajuts.php +++ b/includes/custom-post-type-ajuts.php @@ -56,13 +56,13 @@ // 'delete_private_posts' => 'delete_private_ajuts' // ); $args = array( - 'label' => __( 'ofisuport_ajut', 'text_domain' ), + 'label' => __( 'ofisuport-ajut', 'text_domain' ), 'description' => __( 'Ajuts', 'text_domain' ), 'labels' => $labels, 'supports' => array( 'title', 'editor', 'thumbnail', 'trackbacks', 'revisions', 'custom-fields', 'page-attributes' ), 'taxonomies' => array( - 'ofisuport_ajut_category', - 'ofisuport_ajut_tag' + 'ofisuport-ajut-category', + 'ofisuport-ajut-tag' ), 'hierarchical' => true, 'public' => true, @@ -82,7 +82,7 @@ //'capabilities' => $capabilities, 'map_meta_cap' => true //neded to apply the new capabilities. ); - register_post_type( 'ofisuport_ajut', $args ); + register_post_type( 'ofisuport-ajut', $args ); } // Hook into the 'init' action add_action( 'init', 'ofisuport_wpplugin_custom_post_ajut_init', 0 ); @@ -158,7 +158,7 @@ // 'map_meta_cap' => true //neded to apply the new capabilities. // ); - // register_taxonomy( 'ofisuport_ajut_category', array( 'ofisuport_ajut' ) , $args ); + // register_taxonomy( 'ofisuport-ajut-category', array( 'ofisuport-ajut' ) , $args ); //} // Hook into the 'init' action @@ -207,7 +207,7 @@ // //'capabilities' => $capabilities, // 'map_meta_cap' => true //neded to apply the new capabilities. // ); -// register_taxonomy( 'ofisuport_ajut_tag', array( 'ofisuport_ajut' ) , $args ); +// register_taxonomy( 'ofisuport-ajut-tag', array( 'ofisuport-ajut' ) , $args ); // } // Hook into the 'init' action @@ -217,7 +217,7 @@ // https://wordpress.stackexchange.com/questions/108642/permalinks-custom-post-type-custom-taxonomy-post // change in register_post_type the slug 'rewrite' to this // $rewrite = array( - // 'slug' => 'ajuts/%ofisuport_ajut_category%', + // 'slug' => 'ajuts/%ofisuport-ajut-category%', // 'with_front' => true, // 'hierarchical' => true, // ); @@ -225,10 +225,10 @@ // // function ofisuport_wpplugin_ajut_and_category_permalink( $post_link, $id = 0 ){ // $post = get_post($id); - // if ( is_object( $post ) && $post->post_type == 'ofisuport_ajut' ){ - // $terms = wp_get_object_terms( $post->ID, 'ofisuport_ajut_category' ); + // if ( is_object( $post ) && $post->post_type == 'ofisuport-ajut' ){ + // $terms = wp_get_object_terms( $post->ID, 'ofisuport-ajut-category' ); // if( $terms ){ - // return str_replace( '%ofisuport_ajut_category%' , $terms[0]->slug , $post_link ); + // return str_replace( '%ofisuport-ajut-category%' , $terms[0]->slug , $post_link ); // } // } // return $post_link;