I’m developing a child theme of a premium template, this comes with a custom post type with the label name of “Projects” but I’d like to change it to something else, I know that if I go to the functions.php file of the main theme I can change it easily but I’d like to change it from my child theme so I don’t have to edit any of the original files, is it possible?
Thanks in advance!
There is a global array
$wp_post_types
. You can change$wp_post_types[$post_type]->labels
after the parent theme has set the CPT.So ⦠if the parent theme registers the CPT on
'init'
like this:Then you need a later priority:
⦠or a later hook. I would use
wp_loaded
:Example for custom post type
place
changed tolocation