This function has been deprecated. Use _x() instead.

_c( string $text, string $domain = 'default' )

Retrieve translated string with vertical bar 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.

In order to use the separate contexts, the _c() function is used and the translatable string uses a pipe (‘|’) which has the context the string is in.

When the translated string is returned, it is everything before the pipe, not including the pipe character. If there is no pipe in the translated text then everything is returned.

See also


Parameters

$text

(string) (Required) Text to translate

$domain

(string) (Optional) Domain to retrieve the translated text

Default value: 'default'


Return

(string) Translated context string without pipe


Source

File: wp-includes/deprecated.php

function _c( $text, $domain = 'default' ) {
	_deprecated_function( __FUNCTION__, 'WP-2.9.0', '_x()' );
	return before_last_bar( translate( $text, $domain ) );
}


Changelog

Changelog
Version Description
WP-2.9.0 Use _x()
WP-2.2.0 Introduced. This function has been deprecated. Use _x() instead.