I'm working on e-commerce site using woocommerce plugin. My client will be selling tickets online. woocommerce plugin creates custom post type "Product".

I want to change this cpt singular_name to "Ticket" (just a cosmetic change)

I'm ok with keeping cpt slug to "product" as it requires for other woocommerce functions?


Is there any function/filter available in wordpress to alter custom post type singular_name through function/filter

  • WooCommerce provides a large range of hooks and filters which you can use. Its a plugin specific question and not really specific to WordPress.docs.woothemes.com/document/hooks – Brad Dalton Feb 28 '14 at 13:26
  • OK Thanks. I will have a look. But in general, is there any way to alter it outside any plugin ? not woocommerce only. – MANnDAaR Feb 28 '14 at 13:39

When you look at the source of register_post_type, you'll see that it uses get_post_type_labels(). And this function has a filter:

apply_filters( "post_type_labels_{$post_type}", $labels );

Better use that instead of messing with the actual arguments.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.