0

This question already has an answer here:

I am creating the oh-so-common Events custom post type and I want to use the published date as my event date. Eventually, in my archive, I will make sure to display posts with the scheduled status.

I know I can add a custom metadata, and I am already doing it for other datas, but I believe that in this case using the publishing data is the best. First of all, it will allow me to easily query for upcoming events or past events; secondly, nobody really cares of when an event was published; and thirdly, but most importantly, I want my archives permalinks to have the /date/post/ structure (ex. /2013/10/awesome-event) and it makes much more sense to have the event date there rather than the published date.

I browsed a bit through the WP core file that creates that metabox, and I couldn't find any filter that I could hook in to edit that label. Titles of the metaboxes are easily editable, but it looks like labels not so much.

Any suggestions on how to achieve something like this.

marked as duplicate by brasofilo, fuxia Sep 25 '13 at 23:17

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Functionally, the answer is the same as to this related question: wordpress.stackexchange.com/q/104948/21376 But you can get into a lot of trouble replacing Core functionality like that, even if done with actions and filters. – s_ha_dum Sep 25 '13 at 21:16
  • I really don't want to change any core functionality or data. That is the point: I would like to change a text label, and since it is easy to change the title of a metabox, I though there could/should be a way to change the labels as well. – NinGen ShinRa Sep 25 '13 at 21:30
  • I believe the plugin over there works out of the box for this Question -using 'replacements'=>array('Published'=>'Past event', 'Scheduled'=>'Upcoming') – brasofilo Sep 25 '13 at 22:57
  • @brasofilo Doesn't that solution prevent any further localization? Or how would you handle localization on your new string? Would you just do 'replacements'=>array('Published'=>__('Past event','mydomain')) ? – NinGen ShinRa Oct 1 '13 at 18:09
  • I guess yes, seems ok, but has to be tested. – brasofilo Oct 1 '13 at 18:31