Retrieves translated string with gettext context.
Description
Quite a few times, there will be collisions with similar translatable text found in more than two places, but with different translated context.
By including the context in the pot file, translators can translate the two strings differently.
Parameters
$textstringrequired- Text to translate.
$contextstringrequired- Context information for the translators.
$domainstringoptional- Text domain. Unique identifier for retrieving translated strings.
Default'default'.Default:
'default'
Return
string Translated context string without pipe.Source
function _x( $text, $context, $domain = 'default' ) {
return translate_with_gettext_context( $text, $context, $domain );
}
Related
| Uses | Description |
|---|---|
translate_with_gettext_context()wp-includes/l10n.php | Retrieves the translation of $text in the context defined in $context. |
| Used by | Description |
|---|---|
wp_admin_bar_command_palette_menu()wp-includes/admin-bar.php | Adds the command palette trigger button. |
WP_Debug_Data::get_wp_core()wp-admin/includes/class-wp-debug-data.php | Gets the WordPress core section of the debug data. |
_register_block_bindings_post_data_source()wp-includes/block-bindings/post-data.php | Registers Post Data source in the block bindings registry. |
_register_block_bindings_term_data_source()wp-includes/block-bindings/term-data.php | Registers Term Data source in the block bindings registry. |
_wp_register_default_font_collections()wp-includes/fonts.php | Register the default font collections. |
_register_block_bindings_pattern_overrides_source()wp-includes/block-bindings/pattern-overrides.php | Registers Pattern Overrides source in the Block Bindings registry. |
_register_block_bindings_post_meta_source()wp-includes/block-bindings/post-meta.php | Registers Post Meta source in the block bindings registry. |
WP_Plugin_Dependencies::display_admin_notice_for_circular_dependencies()wp-includes/class-wp-plugin-dependencies.php | Displays an admin notice if circular dependencies are installed. |
wp_get_plugin_action_button()wp-admin/includes/plugin-install.php | Gets the markup for the plugin install action button. |
WP_Navigation_Fallback::create_default_fallback()wp-includes/class-wp-navigation-fallback.php | Creates a default Navigation Block Menu fallback. |
WP_Locale::get_word_count_type()wp-includes/class-wp-locale.php | Retrieves the localized word count type. |
WP_Widget_Media::get_l10n_defaults()wp-includes/widgets/class-wp-widget-media.php | Returns the default localized strings used by the widget. |
WP_Taxonomy::get_default_labels()wp-includes/class-wp-taxonomy.php | Returns the default labels for taxonomies. |
WP_Post_Type::get_default_labels()wp-includes/class-wp-post-type.php | Returns the default labels for post types. |
wp_list_users()wp-includes/user.php | Lists all the users of the site, with several options available. |
get_allowed_block_template_part_areas()wp-includes/block-template-utils.php | Returns a filtered list of allowed area values for template parts. |
get_default_block_template_types()wp-includes/block-template-utils.php | Returns a filtered list of default template types, containing their localized titles and descriptions. |
get_default_block_categories()wp-includes/block-editor.php | Returns the list of default categories for block types. |
wpmu_new_site_admin_notification()wp-includes/ms-functions.php | Notifies the Multisite network administrator that a new site was created. |
_register_core_block_patterns_and_categories()wp-includes/block-patterns.php | Registers the core block patterns and categories. |
validate_theme_requirements()wp-includes/theme.php | Validates the theme requirements for WordPress version and PHP version. |
Plugin_Installer_Skin::do_overwrite()wp-admin/includes/class-plugin-installer-skin.php | Checks if the plugin can be overwritten and outputs the HTML for overwriting a plugin on upload. |
Theme_Installer_Skin::do_overwrite()wp-admin/includes/class-theme-installer-skin.php | Checks if the theme can be overwritten and outputs the HTML for overwriting a theme on upload. |
wp_credits_section_title()wp-admin/includes/credits.php | Displays the title for a given group of contributors. |
get_post_states()wp-admin/includes/template.php | Retrieves an array of post states from a post. |
validate_plugin_requirements()wp-admin/includes/plugin.php | Validates the plugin requirements for WordPress version and PHP version. |
wp_get_default_update_php_url()wp-includes/functions.php | Gets the default URL to learn more about updating the PHP version the site is running on. |
taxonomy_meta_box_sanitize_cb_input()wp-admin/includes/post.php | Sanitizes POST values from an input taxonomy metabox. |
wp_default_packages_scripts()wp-includes/script-loader.php | Registers all the WordPress packages scripts that are in the standardized |
register_and_do_post_meta_boxes()wp-admin/includes/meta-boxes.php | Registers the default post meta boxes, and runs the |
_wp_privacy_statuses()wp-includes/post.php | Returns statuses for privacy requests. |
wp_privacy_generate_personal_data_export_file()wp-admin/includes/privacy-tools.php | Generate the personal data export file. |
WP_Widget_Media_Gallery::__construct()wp-includes/widgets/class-wp-widget-media-gallery.php | Constructor. |
WP_Customize_Nav_Menu_Locations_Control::content_template()wp-includes/customize/class-wp-customize-nav-menu-locations-control.php | JS/Underscore template for the control UI. |
wp_load_press_this()wp-admin/press-this.php | |
WP_Widget_Media_Audio::__construct()wp-includes/widgets/class-wp-widget-media-audio.php | Constructor. |
WP_Widget_Media_Video::__construct()wp-includes/widgets/class-wp-widget-media-video.php | Constructor. |
WP_Widget_Media_Image::__construct()wp-includes/widgets/class-wp-widget-media-image.php | Constructor. |
wp_dashboard_events_news()wp-admin/includes/dashboard.php | Renders the Events and News dashboard widget. |
WP_Community_Events::format_event_data_time()wp-admin/includes/class-wp-community-events.php | Adds formatted date and time items for each event in an API response. |
get_theme_starter_content()wp-includes/theme.php | Expands a theme’s starter content configuration using core-provided data. |
_WP_Editors::get_translation()wp-includes/class-wp-editor.php | |
wp_localize_jquery_ui_datepicker()wp-includes/script-loader.php | Localizes the jQuery UI datepicker. |
wp_print_update_row_templates()wp-admin/includes/update.php | Prints the JavaScript templates for update and deletion rows in list tables. |
rest_output_link_wp_head()wp-includes/rest-api.php | Outputs the REST API link tag into page header. |
rest_output_link_header()wp-includes/rest-api.php | Sends a Link header for the REST API. |
wp_oembed_add_discovery_links()wp-includes/embed.php | Adds oEmbed discovery links in the head element of the website. |
WP_Customize_Manager::customize_pane_settings()wp-includes/class-wp-customize-manager.php | Prints JavaScript settings for parent window. |
wp_get_document_title()wp-includes/general-template.php | Returns document title for the current page. |
wp_maybe_decline_date()wp-includes/functions.php | Determines if the date should be declined. |
WP_Screen::render_meta_boxes_preferences()wp-admin/includes/class-wp-screen.php | Renders the meta boxes preferences. |
WP_Users_List_Table::get_role_list()wp-admin/includes/class-wp-users-list-table.php | Returns an array of translated user role names for a given user object. |
WP_Customize_Nav_Menu_Setting::sanitize()wp-includes/customize/class-wp-customize-nav-menu-setting.php | Sanitize an input. |
WP_Customize_Nav_Menus::search_available_items_query()wp-includes/class-wp-customize-nav-menus.php | Performs post queries for available-item searching. |
WP_Customize_Nav_Menus::enqueue_scripts()wp-includes/class-wp-customize-nav-menus.php | Enqueues scripts and styles for Customizer pane. |
WP_Customize_Nav_Menus::customize_register()wp-includes/class-wp-customize-nav-menus.php | Adds the customizer settings and controls. |
WP_Customize_Nav_Menus::load_available_items_query()wp-includes/class-wp-customize-nav-menus.php | Performs the post_type and taxonomy queries for loading available menu items. |
WP_Posts_List_Table::handle_row_actions()wp-admin/includes/class-wp-posts-list-table.php | Generates and displays row action links. |
WP_MS_Themes_List_Table::column_name()wp-admin/includes/class-wp-ms-themes-list-table.php | Handles the name column output. |
WP_Comments_List_Table::handle_row_actions()wp-admin/includes/class-wp-comments-list-table.php | Generates and displays row actions links. |
WP_MS_Sites_List_Table::handle_row_actions()wp-admin/includes/class-wp-ms-sites-list-table.php | Generates and displays row action links. |
WP_MS_Users_List_Table::column_name()wp-admin/includes/class-wp-ms-users-list-table.php | Handles the name column output. |
WP_Customize_Theme_Control::content_template()wp-includes/customize/class-wp-customize-theme-control.php | Render a JS template for theme display. |
get_avatar_data()wp-includes/link-template.php | Retrieves default data about the avatar. |
the_meta()wp-includes/post-template.php | Displays a list of post custom fields. |
customize_themes_print_templates()wp-admin/includes/theme.php | Prints JS templates for the theme-browsing UI in the Customizer. |
wp_install_maybe_enable_pretty_permalinks()wp-admin/includes/upgrade.php | Maybe enable pretty permalinks on installation. |
get_the_archive_title()wp-includes/general-template.php | Retrieves the archive title based on the queried object. |
get_the_posts_pagination()wp-includes/link-template.php | Retrieves a paginated navigation to next/previous set of posts, when applicable. |
wp_dropdown_languages()wp-includes/l10n.php | Displays or returns a Language selector. |
get_comments_number_text()wp-includes/comment-template.php | Displays the language string for the number of comments the current post has. |
login_footer()wp-login.php | Outputs the footer for the login page. |
network_step1()wp-admin/includes/network.php | Prints step 1 for Network installation process. |
WP_MS_Users_List_Table::get_bulk_actions()wp-admin/includes/class-wp-ms-users-list-table.php | |
WP_MS_Users_List_Table::get_columns()wp-admin/includes/class-wp-ms-users-list-table.php | |
WP_MS_Users_List_Table::get_sortable_columns()wp-admin/includes/class-wp-ms-users-list-table.php | |
get_theme_update_available()wp-admin/includes/theme.php | Retrieves the update link if there is a theme update available. |
WP_Plugins_List_Table::get_bulk_actions()wp-admin/includes/class-wp-plugins-list-table.php | Gets the available bulk actions for the plugins list table. |
WP_Plugins_List_Table::single_row()wp-admin/includes/class-wp-plugins-list-table.php | Generates the markup for a single plugin row. |
WP_Links_List_Table::get_columns()wp-admin/includes/class-wp-links-list-table.php | |
WP_Links_List_Table::get_sortable_columns()wp-admin/includes/class-wp-links-list-table.php | Gets the list of sortable columns. |
install_themes_upload()wp-admin/includes/theme-install.php | Displays a form to upload themes from zip files. |
Theme_Upgrader_Skin::after()wp-admin/includes/class-theme-upgrader-skin.php | Performs an action following a single theme update. |
Plugin_Installer_Skin::after()wp-admin/includes/class-plugin-installer-skin.php | Performs an action following a plugin install. |
Theme_Installer_Skin::after()wp-admin/includes/class-theme-installer-skin.php | Performs an action following a single theme install. |
WP_List_Table::pagination()wp-admin/includes/class-wp-list-table.php | Displays the pagination. |
WP_Theme_Install_List_Table::install_theme_info()wp-admin/includes/class-wp-theme-install-list-table.php | Prints the info for a theme (to be used in the theme installer modal). |
populate_options()wp-admin/includes/schema.php | Create WordPress options and set the default values. |
WP_Theme_Install_List_Table::prepare_items()wp-admin/includes/class-wp-theme-install-list-table.php | |
WP_Theme_Install_List_Table::single_row()wp-admin/includes/class-wp-theme-install-list-table.php | Prints a theme from the WordPress.org API. |
wp_plugin_update_row()wp-admin/includes/update.php | Displays update information for a plugin. |
| wp_theme_update_row() |