Advertisement
BakerMan

Change Upcoming slug to List (The Events Calendar)

Nov 13th, 2012
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.85 KB | None | 0 0
  1. /**
  2.  * Change the "upcoming" string (from The Events Calendar) to "list".
  3.  *
  4.  * Alternatively (and probably more efficiently) this change could be made in
  5.  * a .mo/.po translation file.
  6.  *
  7.  * @param string $translated
  8.  * @param string $untranslated
  9.  * @param string $domain
  10.  * @return string
  11.  */
  12. function changeUpcomingEventsSlug($translated, $untranslated, $domain) {   
  13.     if ($untranslated === 'upcoming' and $domain === 'tribe-events-calendar') {
  14.         remove_filter('gettext', __FUNCTION__, 20, 3);
  15.         return 'list';
  16.     }
  17.     else return $translated;   
  18. }
  19.  
  20.  
  21. /**
  22.  * Set up a filter to change "upcoming" to "list".
  23.  *
  24.  * Before this works effectively you will need to flush the rewrite rules.
  25.  * Normally, visiting Settings > Permalinks (no need to change anything) is
  26.  * sufficient to do this.
  27.  */
  28. add_filter('gettext', 'changeUpcomingEventsSlug', 20, 3);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement