Title: _c
Published: April 25, 2014
Last modified: February 24, 2026

---

# _c( string $text, string $domain ): string

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/_c/?output_format=md#description)
    - [See also](https://developer.wordpress.org/reference/functions/_c/?output_format=md#see-also)
 * [Parameters](https://developer.wordpress.org/reference/functions/_c/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/_c/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/_c/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/_c/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/_c/?output_format=md#changelog)

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

This function has been deprecated since 2.9.0. Use [_x()](https://developer.wordpress.org/reference/functions/_x/)
instead.

Retrieve translated string with vertical bar context

## 󠀁[Description](https://developer.wordpress.org/reference/functions/_c/?output_format=md#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()](https://developer.wordpress.org/reference/functions/_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](https://developer.wordpress.org/reference/functions/_c/?output_format=md#see-also)󠁿

 * [_x()](https://developer.wordpress.org/reference/functions/_x/)

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

 `$text`stringrequired

Text to translate.

`$domain`stringoptional

Domain to retrieve the translated text.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/_c/?output_format=md#return)󠁿

 string Translated context string without pipe.

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

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

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

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

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

Removes last item on a pipe-delimited string.

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

Retrieves the translation of $text.

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

Marks a function as deprecated and inform when it has been used.

  |

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

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

| Version | Description | 
| [2.9.0](https://developer.wordpress.org/reference/since/2.9.0/) | Deprecated. Use [_x()](https://developer.wordpress.org/reference/functions/_x/)  | 
| [2.2.0](https://developer.wordpress.org/reference/since/2.2.0/) | Introduced. |

## User Contributed Notes

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