translations_api

Allows a plugin to override the WordPress.org Translation Install API entirely.

Description

apply_filters( 'translations_api', (bool) $false, (string) $type, (object) $args ); 

Parameters (3)

0. $false (bool) => false
The result object. Default false.
1. $type (string)
The type of translations being requested.
2. $args (object)
Translation API arguments.

Usage

To run the hook, copy the example below.
  1. $false = apply_filters( 'translations_api', $false, $type, $args ); 
  2.  
  3. if ( !empty( $false ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the translations_api callback 
  2. function filter_translations_api( $false, $type, $args ) { 
  3. // make filter magic happen here... 
  4. return $false
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'translations_api', 'filter_translations_api', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'translations_api', 'filter_translations_api', 10, 3 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-admin/includes/translation-install.php  
  1. $res = apply_filters( 'translations_api', false, $type, $args );