0

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?

cpt_product

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

2
  • 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 Commented Feb 28, 2014 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
    Commented Feb 28, 2014 at 13:39

1 Answer 1

1

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.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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