Reason to add a name of the theme like ('menu-1' => __( 'Primary', 'twentynineteen' ),) in PHP?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















Sorry for this novice question. I'd like to know why WordPress themes add their theme names many occasions in PHP files (e.g. where 'twentynineteen' is repeated below, this is from functions.php in twentynineteen theme). Looks like themes can function fine without those names included, though.



register_nav_menus(
array(
'menu-1' => __( 'Primary', 'twentynineteen' ),
'footer' => __( 'Footer Menu', 'twentynineteen' ),
'social' => __( 'Social Links Menu', 'twentynineteen' ),
)
);


Is there any particular reason why theme names are included? Thank you in advance for your advice!










share|improve this question







New contributor




Joey is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



























    0















    Sorry for this novice question. I'd like to know why WordPress themes add their theme names many occasions in PHP files (e.g. where 'twentynineteen' is repeated below, this is from functions.php in twentynineteen theme). Looks like themes can function fine without those names included, though.



    register_nav_menus(
    array(
    'menu-1' => __( 'Primary', 'twentynineteen' ),
    'footer' => __( 'Footer Menu', 'twentynineteen' ),
    'social' => __( 'Social Links Menu', 'twentynineteen' ),
    )
    );


    Is there any particular reason why theme names are included? Thank you in advance for your advice!










    share|improve this question







    New contributor




    Joey is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      Sorry for this novice question. I'd like to know why WordPress themes add their theme names many occasions in PHP files (e.g. where 'twentynineteen' is repeated below, this is from functions.php in twentynineteen theme). Looks like themes can function fine without those names included, though.



      register_nav_menus(
      array(
      'menu-1' => __( 'Primary', 'twentynineteen' ),
      'footer' => __( 'Footer Menu', 'twentynineteen' ),
      'social' => __( 'Social Links Menu', 'twentynineteen' ),
      )
      );


      Is there any particular reason why theme names are included? Thank you in advance for your advice!










      share|improve this question







      New contributor




      Joey is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      Sorry for this novice question. I'd like to know why WordPress themes add their theme names many occasions in PHP files (e.g. where 'twentynineteen' is repeated below, this is from functions.php in twentynineteen theme). Looks like themes can function fine without those names included, though.



      register_nav_menus(
      array(
      'menu-1' => __( 'Primary', 'twentynineteen' ),
      'footer' => __( 'Footer Menu', 'twentynineteen' ),
      'social' => __( 'Social Links Menu', 'twentynineteen' ),
      )
      );


      Is there any particular reason why theme names are included? Thank you in advance for your advice!







      php theme-development themes






      share|improve this question







      New contributor




      Joey is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      Joey is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      Joey is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked Apr 20 at 8:06









      JoeyJoey

      134




      134




      New contributor




      Joey is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Joey is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Joey is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          1 Answer
          1






          active

          oldest

          votes


















          2














          The name you see is the text domain of the theme. __('some text', 'text-domain') is a translation function, which makes it possible to translate the some text into different languages. There are also other translation functions that can be used in different situations. You can learn more about translations on the codex, I18n



          P.s. if the text domain is left out, the function uses default WP text domain and tries to find translations from that. For example simple strings, like yes and no, usually gets translated from the default translations.






          share|improve this answer


























          • Haha, you were faster. I was about to push the submit button :p

            – Krzysiek Dróżdż
            Apr 20 at 8:18






          • 1





            Haha, I had the feeling that answering to this question would be a speed typing contest :D

            – Antti Koskinen
            Apr 20 at 8:23











          • Thank you both for getting back to me with a pointer. I'll read the resource. Thanks!

            – Joey
            Apr 20 at 8:26












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "110"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          Joey is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fwordpress.stackexchange.com%2fquestions%2f334851%2freason-to-add-a-name-of-the-theme-like-menu-1-primary-twentyninete%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          The name you see is the text domain of the theme. __('some text', 'text-domain') is a translation function, which makes it possible to translate the some text into different languages. There are also other translation functions that can be used in different situations. You can learn more about translations on the codex, I18n



          P.s. if the text domain is left out, the function uses default WP text domain and tries to find translations from that. For example simple strings, like yes and no, usually gets translated from the default translations.






          share|improve this answer


























          • Haha, you were faster. I was about to push the submit button :p

            – Krzysiek Dróżdż
            Apr 20 at 8:18






          • 1





            Haha, I had the feeling that answering to this question would be a speed typing contest :D

            – Antti Koskinen
            Apr 20 at 8:23











          • Thank you both for getting back to me with a pointer. I'll read the resource. Thanks!

            – Joey
            Apr 20 at 8:26
















          2














          The name you see is the text domain of the theme. __('some text', 'text-domain') is a translation function, which makes it possible to translate the some text into different languages. There are also other translation functions that can be used in different situations. You can learn more about translations on the codex, I18n



          P.s. if the text domain is left out, the function uses default WP text domain and tries to find translations from that. For example simple strings, like yes and no, usually gets translated from the default translations.






          share|improve this answer


























          • Haha, you were faster. I was about to push the submit button :p

            – Krzysiek Dróżdż
            Apr 20 at 8:18






          • 1





            Haha, I had the feeling that answering to this question would be a speed typing contest :D

            – Antti Koskinen
            Apr 20 at 8:23











          • Thank you both for getting back to me with a pointer. I'll read the resource. Thanks!

            – Joey
            Apr 20 at 8:26














          2












          2








          2







          The name you see is the text domain of the theme. __('some text', 'text-domain') is a translation function, which makes it possible to translate the some text into different languages. There are also other translation functions that can be used in different situations. You can learn more about translations on the codex, I18n



          P.s. if the text domain is left out, the function uses default WP text domain and tries to find translations from that. For example simple strings, like yes and no, usually gets translated from the default translations.






          share|improve this answer















          The name you see is the text domain of the theme. __('some text', 'text-domain') is a translation function, which makes it possible to translate the some text into different languages. There are also other translation functions that can be used in different situations. You can learn more about translations on the codex, I18n



          P.s. if the text domain is left out, the function uses default WP text domain and tries to find translations from that. For example simple strings, like yes and no, usually gets translated from the default translations.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Apr 20 at 8:42

























          answered Apr 20 at 8:17









          Antti KoskinenAntti Koskinen

          9471412




          9471412













          • Haha, you were faster. I was about to push the submit button :p

            – Krzysiek Dróżdż
            Apr 20 at 8:18






          • 1





            Haha, I had the feeling that answering to this question would be a speed typing contest :D

            – Antti Koskinen
            Apr 20 at 8:23











          • Thank you both for getting back to me with a pointer. I'll read the resource. Thanks!

            – Joey
            Apr 20 at 8:26



















          • Haha, you were faster. I was about to push the submit button :p

            – Krzysiek Dróżdż
            Apr 20 at 8:18






          • 1





            Haha, I had the feeling that answering to this question would be a speed typing contest :D

            – Antti Koskinen
            Apr 20 at 8:23











          • Thank you both for getting back to me with a pointer. I'll read the resource. Thanks!

            – Joey
            Apr 20 at 8:26

















          Haha, you were faster. I was about to push the submit button :p

          – Krzysiek Dróżdż
          Apr 20 at 8:18





          Haha, you were faster. I was about to push the submit button :p

          – Krzysiek Dróżdż
          Apr 20 at 8:18




          1




          1





          Haha, I had the feeling that answering to this question would be a speed typing contest :D

          – Antti Koskinen
          Apr 20 at 8:23





          Haha, I had the feeling that answering to this question would be a speed typing contest :D

          – Antti Koskinen
          Apr 20 at 8:23













          Thank you both for getting back to me with a pointer. I'll read the resource. Thanks!

          – Joey
          Apr 20 at 8:26





          Thank you both for getting back to me with a pointer. I'll read the resource. Thanks!

          – Joey
          Apr 20 at 8:26










          Joey is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          Joey is a new contributor. Be nice, and check out our Code of Conduct.













          Joey is a new contributor. Be nice, and check out our Code of Conduct.












          Joey is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to WordPress Development Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fwordpress.stackexchange.com%2fquestions%2f334851%2freason-to-add-a-name-of-the-theme-like-menu-1-primary-twentyninete%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to put 3 figures in Latex with 2 figures side by side and 1 below these side by side images but in...

          In PowerPoint, is there a keyboard shortcut for bulleted / numbered list?

          IC on Digikey is 5x more expensive than board containing same IC on Alibaba: How? [on hold]