PHP Class Mlp_Term_Translation

Author: Inpsyde GmbH, toscho
Show file Open project: inpsyde/multilingual-press Class Usage Examples

Public Methods

Method Description
__construct ( wpdb $wpdb, WP_Rewrite $wp_rewrite, Inpsyde\MultilingualPress\Factory\TypeFactory $type_factory )
get_translation ( integer $term_taxonomy_id, integer $target_site_id ) : array | boolean Get term translation.

Private Methods

Method Description
fix_term_base ( string $taxonomy ) : boolean | string Updates the global wp_rewrite instance if it is wrong
get_admin_translation ( array $term, string $taxonomy ) : array | boolean Get term in backend
get_expected_base ( string $taxonomy ) : boolean | string Find a custom taxonomy base
get_public_url ( integer $term_id, string $taxonomy ) : string Prepare the tax base before the URL is fetched
get_term_by_term_taxonomy_id ( integer $term_taxonomy_id ) : array Get a term by its term taxonomy ID.
get_term_by_term_taxonomy_id_cache_key ( integer $term_taxonomy_id ) : string Returns the get_term_by_term_taxonomy_id cache key for the given term taxonomy ID.
get_translation_in_target_site ( integer $term_taxonomy_id ) : array | boolean Get term translation
set_permastruct ( string $taxonomy, string $struct ) : void Update global WP_Rewrite instance
update_required ( string | boolean $expected, string | boolean $existing ) : boolean Compare tax bases

Method Details

__construct() public method

public __construct ( wpdb $wpdb, WP_Rewrite $wp_rewrite, Inpsyde\MultilingualPress\Factory\TypeFactory $type_factory )
$wpdb wpdb
$wp_rewrite WP_Rewrite
$type_factory Inpsyde\MultilingualPress\Factory\TypeFactory Type factory object.

get_translation() public method

Runs in the context of the source site.
public get_translation ( integer $term_taxonomy_id, integer $target_site_id ) : array | boolean
$term_taxonomy_id integer
$target_site_id integer
return array | boolean