gettext_with_context
Filters text with its translation based on context information.
Description
apply_filters( 'gettext_with_context', (unknown) $translations_translate_text_context, (unknown) $text, (unknown) $context, (unknown) $domain );
Parameters (4)
- 0. $translations_translate_text_context (unknown)
- The
translations
translate text context. - 1. $text (unknown)
- The text.
- 2. $context (unknown)
- The context.
- 3. $domain (unknown)
- The domain.
Usage
- To run the hook, copy the example below.
- $translations_translate_text_context = apply_filters( 'gettext_with_context', $translations_translate_text_context, $text, $context, $domain );
- if ( !empty( $translations_translate_text_context ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the gettext_with_context callback
- function filter_gettext_with_context( $translations_translate_text_context, $text, $context, $domain ) {
- // make filter magic happen here...
- return $translations_translate_text_context;
- };
- // add the filter
- add_filter( 'gettext_with_context', 'filter_gettext_with_context', 10, 4 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'gettext_with_context', 'filter_gettext_with_context', 10, 4 );
Defined (1)
The filter is defined in the following location(s).
- /bp-forums/bbpress/bb-includes/functions.bb-l10n.php
- return apply_filters( 'gettext_with_context', $translations->translate( $text, $context ), $text, $context, $domain);