Craig
Craig

Reputation: 1962

What is the correct code for adding Sidebar functionality in WordPress?

Is anyone able to tell me if there is any difference between:

'name' => __('Main content left'),

and:

'name' => 'Main content left',

I have used both variations, when adding Sidebar Functionality to my WordPress Theme, and they both work. I have checked the WordPress forums, as well as ther Codex, as it seems that the two variants are used there too. I am just wondering if I am overlooking something or if there may be a compatibility/performance issue with one or the other.

Upvotes: 0

Views: 58

Answers (1)

Thorny84
Thorny84

Reputation: 335

the second is only a string. the first is a function that serves for the translation of the string, it also requires a second parameter called text domain. view this https://developer.wordpress.org/reference/functions/__/

Upvotes: 4

Related Questions