Last active
August 29, 2015 14:15
-
-
Save goliver79/324409b6b41d01cbbdcc to your computer and use it in GitHub Desktop.
[WORDPRESS] qTranslate slug for custom taxonomies
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 | |
/** | |
* | |
* http://www.computersolutions.cn/blog/2013/01/custom-taxonomies-in-wordpress-and-qtranslate-translation-problem-resolution/ | |
* | |
* Works with mqTranslate, qTranslate | |
* | |
*/ | |
function qtranslate_edit_taxonomies(){ | |
$args=array( | |
'public' => true , | |
'_builtin' => false | |
); | |
$output = 'object'; // or objects | |
$operator = 'and'; // 'and' or 'or' | |
$taxonomies = get_taxonomies($args,$output,$operator); | |
if ($taxonomies) { | |
foreach ($taxonomies as $taxonomy ) { | |
add_action( $taxonomy->name.'_add_form', 'qtrans_modifyTermFormFor'); | |
add_action( $taxonomy->name.'_edit_form', 'qtrans_modifyTermFormFor'); | |
} | |
} | |
} | |
add_action('admin_init', 'qtranslate_edit_taxonomies'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment