8. Developers

1. wpMula functions

wa_translate_get_site( $blog_id )

Get a site including the wpMula options.

– $blog_id (int) : the id of a blog (optional)

Result is an object containing this information

wa_translate_get_site_lng( $blog_id )

Get a site language.

– $blog_id (int) : the id of a blog (optional)

Result is the slug, for example: en, nl or de

wa_translate_get_sites()

Get all sites in the network with the wpMula options.

– No parameters

Result is an array containing objects

wa_translate_site_active( $site )

Check if the site is visible on the front-end of the website.

– $site (object) : An wpMula site object

Result is a boolean true/false

wa_translate_get_object_translations( $id, $type )

Get all translations of an object, pending on the id and type.

– $id (int) : An ID of an object (optional)
– $type (string) : Type of object, for example ‘post’ or ‘term’

Result is an array containing all this objects translations

wa_translate_get_language_switch_items( $current, $object_id, $object_type )

Retreive language switch items for an object.

– $current (boolean) : include the current object
– $object_id (int) : An ID of an object (optional)
– $object_type (string) : Type of object, for example ‘post’ or ‘term’

Result is an array containing the language switch items of an object.

2. WordPress filters

wpmula_default_langs( $languages )

Modify the default list of available languages.

– $languages (array): by default contains en_US

wpmula_get_site_option( $result, $option, $blog_id )

Modify a wpMula site option result.

– $result (any): a boolean/array/string/int
– $option (string): the name of the option
– $blog_id (int): the blog ID of the translation the option is from

wpmula_get_main_option( $result, $option )

Modify a wpMula main option result.

– $result (any): a boolean/array/string/int
– $option (string): the name of the option

wpmula_site_prefix( $prefix, $site )

Modify the wpMula site option prefix.

– $prefix (string): a string with the default prefix
– $site (string): the blog ID

wpmula_get_site( $site, $blog_id )

Modify the get site result.

– $site (object): the site with all properties
– $blog_id (string): the blog ID

wpmula_site_active( $site )

Modify whether a site is active or not.

– $result (boolean): true or false
– $site (object): the site with all properties

wpmula_get_sites( $sites )

Modify the list of sites.

– $sites (array): a list of site objects

wpmula_get_available_sites( $sites )

Modify the list related to the current translation.

– $sites (array): a list of site objects

wpmula_get_langs_enabled( $languages )

Modify the list of enabled languages.

– $languages (array): a list of languages

wpmula_get_langs_wp( $result )

Modify the list of enabled languages in WordPress.

– $result (boolean/array): a list of languages or false

wpmula_get_object( $object, $id, $type, $blog_id )

Modify an object, such as a post or term.

– $object (object): all information about the object translation
– $id (int): the ID of the object
– $type (string): the type of the object
– $blog_id (int): the ID of the blog to retrieve from

wpmula_get_object_translations( $translations, $id, $type )

Modify the array of translations for this object.

– $translations (array): all translations of this object
– $id (int): the ID of the object
– $type (string): the type of the object

wpmula_get_upload_dir( $upload_dir )

Modify the upload directory used by wpMula.

– $upload_dir (object): information about the upload paths

wpmula_get_site( $site, $blog_id )

Modify the retrieved site object.

– $site (object/boolean): the site with all properties or false
– $blog_id (int): the ID of the retrieved site

wpmula_get_site_lng( $lang, $blog_id )

Modify the retrieved site language.

– $lang (string/boolean): the site language or false
– $blog_id (int): the ID of the retrieved site

wpmula_get_language_switch_items( $items, $current, $object_id, $object_type )

Modify the retrieved language switch items.

– $items (array): list of language switch items
– $current (boolean): display the current language
– $object_id (int): the object to retrieve the language switch items from
– $object_type (string): the type of the object (post/term)