Last active
March 11, 2022 00:13
-
-
Save afragen/f9f1a9558258065afe7dab30557c50f4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Add Categories for WMPL translated sites and Category Colors | |
* Plugin URI: https://gist.github.com/afragen/f9f1a9558258065afe7dab30557c50f4 | |
* Description: Add translated categories to The Events Calendar for The Events Calendar Category Colors. | |
* Version: 0.1 | |
* Author: Andy Fragen | |
* License: MIT | |
* Requires at least: 5.2 | |
* Requires PHP: 7.0 | |
* Gist Plugin URI: https://gist.github.com/afragen/f9f1a9558258065afe7dab30557c50f4 | |
*/ | |
// If using WPML you must ensure that Event Categories (tribe_events_cat) are not translated. | |
add_filter( | |
'teccc_add_terms', | |
function() { | |
$translated_terms = [ | |
'annual', | |
'corve', | |
'course-training', | |
'ice-climbing', | |
'indoor-climbing', | |
'outdoor-climbing', | |
'hiking-trekking', | |
'cross-country-ski', | |
'touring-ski', | |
'alpine-route-ski', | |
'telemark-ski', | |
'annuel', | |
'corvee', | |
'cours-formation', | |
'escalade-de-glace', | |
'escalade-en-salle', | |
'escalade-exterieur', | |
'randonnee', | |
'ski-de-fond', | |
'ski-de-randonnee', | |
'ski-haute-route', | |
'ski-telemark', | |
]; | |
return $translated_terms; | |
} | |
); | |
// Primary French / / English /// English slug //// French slug | |
// Annuel // Annual /// annual //// annuel | |
// Corvée // Corvé /// corve //// corvee | |
// Cours/ Formation // Course / Training /// course-training //// cours-formation | |
// Escalade de glace // Ice Climbing /// ice-climbing //// escalade-de-glace | |
// Escalade en Salle // Indoor Climbing /// indoor-climbing //// escalade-en-salle | |
// Escalade extérieur // Outdoor Climbing /// outdoor-climbing //// escalade-exterieur | |
// Randonnée // Trekking /// hiking-trekking //// randonnee | |
// Ski de fond // Country Ski /// cross-country-ski //// ski-de-fond | |
// Ski de randonnée // Touring Ski /// touring-ski //// ski-de-randonnee | |
// Ski haute route // Alpine Route Ski /// alpine-route-ski //// ski-haute-route | |
// Ski Télémark // Telemark Ski /// telemark-ski //// ski-telemark |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment