woocommerce / projects

38 stars 24 forks source link

Just Question about class taxonomy #71

Closed abouolia closed 10 years ago

abouolia commented 10 years ago

i had question about class taxonomy, Why is not there function to change plural/singular names of the taxonomy by filter hook as in class project exactly in function post_type_names() ?

jameskoster commented 10 years ago

No reason, we just haven't added one. Feel free to send a PR ;-)

abouolia commented 10 years ago

I've found can't add filter hook to taxonomy because the __construct of the class contains on params (singular, plural) can be define this class as more than one time under different names so add filter hook will changes names in all taxs defined, but there's solution for this problem add filter hook under token name for example add_filter('projectstaxonomy[token]_singular_name') what do you think in this idea?

Sorry for my English

jameskoster commented 10 years ago

Yup that sounds good. So just to confirm, you're proposing we change;

$this->plural = esc_html( $plural );

to

$this->plural = apply_filters( 'projects_taxonomy_' . $this->token . '_plural_name', $plural_name = esc_html( $plural ) );

in __construct() in the Projects_Taxonomy class, correct?

If so go ahead and send a PR :-)

abouolia commented 10 years ago

That's exactly what i mean - https://github.com/woothemes/projects/pull/72