Title: _ex
Published: April 25, 2014
Last modified: August 20, 2026

---

# _ex( string $text, string $context, string $domain = 'default' )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/_ex/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/functions/_ex/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/_ex/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/_ex/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/_ex/?output_format=md#wp--skip-link--target)

Displays translated string with gettext context.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/_ex/?output_format=md#parameters)󠁿

 `$text`stringrequired

Text to translate.

`$context`stringrequired

Context information for the translators.

`$domain`stringoptional

Text domain. Unique identifier for retrieving translated strings.
 Default `'default'`.

Default:`'default'`

## 󠀁[Source](https://developer.wordpress.org/reference/functions/_ex/?output_format=md#source)󠁿

    ```php
    function _ex( $text, $context, $domain = 'default' ) {
    	echo _x( $text, $context, $domain );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/l10n.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/l10n.php#L423)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/l10n.php#L423-L425)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/_ex/?output_format=md#related)󠁿

| Uses | Description | 
| [_x()](https://developer.wordpress.org/reference/functions/_x/)`wp-includes/l10n.php` |

Retrieves translated string with gettext context.

  |

| Used by | Description | 
| [WP_Customize_Themes_Panel::render_template()](https://developer.wordpress.org/reference/classes/wp_customize_themes_panel/render_template/)`wp-includes/customize/class-wp-customize-themes-panel.php` |

An Underscore (JS) template for rendering this panel’s container.

  | 
| [WP_Customize_Theme_Control::content_template()](https://developer.wordpress.org/reference/classes/wp_customize_theme_control/content_template/)`wp-includes/customize/class-wp-customize-theme-control.php` |

Render a JS template for theme display.

  | 
| [customize_themes_print_templates()](https://developer.wordpress.org/reference/functions/customize_themes_print_templates/)`wp-admin/includes/theme.php` |

Prints JS templates for the theme-browsing UI in the Customizer.

  | 
| [wp_print_revision_templates()](https://developer.wordpress.org/reference/functions/wp_print_revision_templates/)`wp-admin/includes/revision.php` |

Print JavaScript templates required for the revisions experience.

  | 
| [display_setup_form()](https://developer.wordpress.org/reference/functions/display_setup_form/)`wp-admin/install.php` |

Displays installer setup form.

  | 
| [install_theme_search_form()](https://developer.wordpress.org/reference/functions/install_theme_search_form/)`wp-admin/includes/theme-install.php` |

Displays search form for searching themes.

  | 
| [install_search_form()](https://developer.wordpress.org/reference/functions/install_search_form/)`wp-admin/includes/plugin-install.php` |

Displays a search form for searching plugins.

  | 
| [install_plugin_information()](https://developer.wordpress.org/reference/functions/install_plugin_information/)`wp-admin/includes/plugin-install.php` |

Displays plugin information in dialog box form.

  | 
| [list_meta()](https://developer.wordpress.org/reference/functions/list_meta/)`wp-admin/includes/template.php` |

Outputs a post’s public meta data in the Custom Fields meta box.

  | 
| [meta_form()](https://developer.wordpress.org/reference/functions/meta_form/)`wp-admin/includes/template.php` |

Prints the form in the Custom Fields meta box.

  | 
| [media_upload_gallery_form()](https://developer.wordpress.org/reference/functions/media_upload_gallery_form/)`wp-admin/includes/media.php` |

Adds gallery form to upload iframe.

  | 
| [media_upload_form()](https://developer.wordpress.org/reference/functions/media_upload_form/)`wp-admin/includes/media.php` |

Outputs the legacy media upload form.

  | 
| [link_categories_meta_box()](https://developer.wordpress.org/reference/functions/link_categories_meta_box/)`wp-admin/includes/meta-boxes.php` |

Displays link categories form fields.

  | 
| [link_xfn_meta_box()](https://developer.wordpress.org/reference/functions/link_xfn_meta_box/)`wp-admin/includes/meta-boxes.php` |

Displays XFN form fields.

  | 
| [link_advanced_meta_box()](https://developer.wordpress.org/reference/functions/link_advanced_meta_box/)`wp-admin/includes/meta-boxes.php` |

Displays advanced link options form fields.

  | 
| [post_submit_meta_box()](https://developer.wordpress.org/reference/functions/post_submit_meta_box/)`wp-admin/includes/meta-boxes.php` |

Displays post submit form fields.

  | 
| [WP_Terms_List_Table::inline_edit()](https://developer.wordpress.org/reference/classes/wp_terms_list_table/inline_edit/)`wp-admin/includes/class-wp-terms-list-table.php` |

Outputs the hidden row displayed when inline editing

  | 
| [WP_Posts_List_Table::inline_edit()](https://developer.wordpress.org/reference/classes/wp_posts_list_table/inline_edit/)`wp-admin/includes/class-wp-posts-list-table.php` |

Outputs the hidden row displayed when inline editing

  | 
| [wp_widget_control()](https://developer.wordpress.org/reference/functions/wp_widget_control/)`wp-admin/includes/widgets.php` |

Meta widget used to display the control form for a widget.

  | 
| [Custom_Background::admin_page()](https://developer.wordpress.org/reference/classes/custom_background/admin_page/)`wp-admin/includes/class-custom-background.php` |

Displays the custom background page.

  | 
| [WP_Widget_Links::form()](https://developer.wordpress.org/reference/classes/wp_widget_links/form/)`wp-includes/widgets/class-wp-widget-links.php` |

Outputs the settings form for the Links widget.

  | 
| [WP_Customize_Header_Image_Control::render_content()](https://developer.wordpress.org/reference/classes/wp_customize_header_image_control/render_content/)`wp-includes/customize/class-wp-customize-header-image-control.php` |

Renders the control’s content.

  | 
| [wp_print_media_templates()](https://developer.wordpress.org/reference/functions/wp_print_media_templates/)`wp-includes/media-template.php` |

Prints the templates used in the media manager.

  |

[Show 18 more](https://developer.wordpress.org/reference/functions/_ex/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/_ex/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/_ex/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.0.0](https://developer.wordpress.org/reference/since/3.0.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2F_ex%2F)
before being able to contribute a note or feedback.