Title: ffto's Replies | WordPress.org

---

# ffto

  [  ](https://wordpress.org/support/users/ffto/)

 *   [Profile](https://wordpress.org/support/users/ffto/)
 *   [Topics Started](https://wordpress.org/support/users/ffto/topics/)
 *   [Replies Created](https://wordpress.org/support/users/ffto/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/ffto/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/ffto/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/ffto/engagements/)
 *   [Favorites](https://wordpress.org/support/users/ffto/favorites/)

 Search replies:

## Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[YARPP Experiments] No longer visible](https://wordpress.org/support/topic/no-longer-visible-1/)
 *  [ffto](https://wordpress.org/support/users/ffto/)
 * (@ffto)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/no-longer-visible-1/#post-4916416)
 * Robanna, I had the same problem,
 * Here’s a quick fix:
    Go to /wp-content/plugins/yet-another-related-posts-plugin/
   yarpp_meta_boxes_hooks.php
 * at the end, uncomment the last line saying:
    // do_action(‘add_meta_boxes_settings_page_yarpp’);
 * The experiments boxes will then show.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Social Accounts] in Add Account area the icon keeps defaulting to the globe](https://wordpress.org/support/topic/in-add-account-area-the-icon-keeps-defaulting-to-the-globe/)
 *  Plugin Author [ffto](https://wordpress.org/support/users/ffto/)
 * (@ffto)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/in-add-account-area-the-icon-keeps-defaulting-to-the-globe/#post-3653213)
 * Hi thesturs,
 * I’m really sorry I haven’t answered before, I haven’t checked my account in a
   long time, I’ll look into this this weekend.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[CPT-onomies: Using Custom Post Types as Taxonomies] [Plugin: CPT-onomies: Using Custom Post Types as Taxonomies] Feature : Better integration with WPML](https://wordpress.org/support/topic/plugin-cpt-onomies-using-custom-post-types-as-taxonomies-feature-better-integration-with-wpml/)
 *  [ffto](https://wordpress.org/support/users/ffto/)
 * (@ffto)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-cpt-onomies-using-custom-post-types-as-taxonomies-feature-better-integration-with-wpml/#post-2709217)
 * Hi sireneweb,
 * does the second function I posted worked? I compared your function with the WPML
   one “get_language_for_element” and it’s exactly the same code.
 * i’ve updated the function again, to validate if the user has WPML turned off,
   so it degrades gracefully without errors.
 *     ```
       function filter_cptonomies_get_terms ( $terms, $taxonomies, $args ){
       	global $sitepress;
       	if ( !isset( $sitepress ) ) return $terms;
   
       	$post_types = get_post_types();
       	foreach ( $terms as $iTerm => $term ){
       		if ( in_array( $term->taxonomy , $post_types ) ){
       			$post		= get_posts( 'suppress_filters=1&post_per_page=1&post_type='.$term->taxonomy.'&name='.$term->slug );
       			$lang		= strtoupper( $sitepress->get_language_for_element( $post[0]->ID, "post_{$term->taxonomy}" ) );
       			$current	= strtoupper( ICL_LANGUAGE_CODE );
   
       			if ( is_admin() ){
       				$term->name = "{$term->name} ({$lang})";
       			}elseif ( $lang !== $current ) {
       				unset( $terms[$iTerm] );
       			}
       		}
       	}
       	return $terms;
       }
       add_filter( 'get_terms' , 'filter_cptonomies_get_terms' , 20 , 3 );
       ```
   
 * Do you have an example of the bug? I’m not able to reproduce the problem.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[CPT-onomies: Using Custom Post Types as Taxonomies] [Plugin: CPT-onomies: Using Custom Post Types as Taxonomies] Feature : Better integration with WPML](https://wordpress.org/support/topic/plugin-cpt-onomies-using-custom-post-types-as-taxonomies-feature-better-integration-with-wpml/)
 *  [ffto](https://wordpress.org/support/users/ffto/)
 * (@ffto)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-cpt-onomies-using-custom-post-types-as-taxonomies-feature-better-integration-with-wpml/#post-2709215)
 * here’s an updated version :
 *     ```
       function filter_cptonomies_get_terms ( $terms, $taxonomies, $args ){
       	global $sitepress;
       	$post_types = get_post_types();
       	foreach ( $terms as $iTerm => $term ){
       		if ( in_array( $term->taxonomy , $post_types ) ){
       			$post		= get_posts( 'post_per_page=1&post_type='.$term->taxonomy.'&name='.$term->slug );
       			$lang		= strtoupper( $sitepress->get_language_for_element($post[0]->ID, "post_{$term->taxonomy}" ) );
       			$current	= strtoupper( ICL_LANGUAGE_CODE );
   
       			if ( is_admin() ){
       				$term->name = "{$term->name} ({$lang})";
       			}elseif ( $lang !== $current ) {
       				unset( $terms[$iTerm] );
       			}
       		}
       	}
       	return $terms;
       }
       add_filter( 'get_terms' , 'filter_cptonomies_get_terms' , 20 , 3 );
       ```
   
 * it shows the LANG when in the back end, but when in the front end, it shows only
   the ones in the current languages.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Advanced Ticket System, Elite Support Helpdesk] [Plugin: WordPress Advanced Ticket System] How to edit the Custom fields](https://wordpress.org/support/topic/plugin-wordpress-advanced-ticket-system-how-to-edit-the-custom-fields/)
 *  Thread Starter [ffto](https://wordpress.org/support/users/ffto/)
 * (@ffto)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-wordpress-advanced-ticket-system-how-to-edit-the-custom-fields/#post-2776733)
 * thank you, it works really well
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[CPT-onomies: Using Custom Post Types as Taxonomies] [Plugin: CPT-onomies: Using Custom Post Types as Taxonomies] Feature : Better integration with WPML](https://wordpress.org/support/topic/plugin-cpt-onomies-using-custom-post-types-as-taxonomies-feature-better-integration-with-wpml/)
 *  [ffto](https://wordpress.org/support/users/ffto/)
 * (@ffto)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-cpt-onomies-using-custom-post-types-as-taxonomies-feature-better-integration-with-wpml/#post-2709213)
 * Hi sireneweb,
 * I had the same problem, so I added this code to my **functions.php**:
 *     ```
       function filter_cptonomies_get_terms ( $terms, $taxonomies, $args ){
       	global $sitepress;
       	$post_types = get_post_types();
       	foreach ( $terms as $iTerm => $term ){
       		if ( in_array( $term->taxonomy , $post_types ) ){
       			$post	= get_posts( 'post_per_page=1&post_type='.$term->taxonomy.'&name='.$term->slug );
       			$lang	= $sitepress->get_language_for_element($post[0]->ID, "post_{$term->taxonomy}" );
       			$term->name = "{$term->name} ({$lang})";
       		}
       	}
       	return $terms;
       }
       add_filter( 'get_terms' , 'filter_cptonomies_get_terms' , 20 , 3 );
       ```
   
 * I would have preferred showing only the current language cpt-onomies, but when
   you change the language of the post (in the Language metabox), it reloads the
   Category taxonomy, but not the CPT-onomies taxonomies.
 * I’m sure I could figure out what jQuery function gets triggered to reload the
   default taxonomy, but adding the language to the term name is good enough I think.

Viewing 6 replies - 1 through 6 (of 6 total)