Changing the titles on My Account pages in Woocommerce












2















I've seen loads of example of how to re-order / change the navigation and page with the WooCommerce my account dashboard. But i can't for the life of me work out how to change the main titles for each section (My Account, Orders, Downloads, Addresses etc).



I've searched through the templates but no joy. I've tried using conditional php comments to echo the titles for the correct page. But it doesn't work because my account section uses endpoints. I've tried adding a filter, but no joy. Anyone got any idea how i change these titles?



Thanks










share|improve this question





























    2















    I've seen loads of example of how to re-order / change the navigation and page with the WooCommerce my account dashboard. But i can't for the life of me work out how to change the main titles for each section (My Account, Orders, Downloads, Addresses etc).



    I've searched through the templates but no joy. I've tried using conditional php comments to echo the titles for the correct page. But it doesn't work because my account section uses endpoints. I've tried adding a filter, but no joy. Anyone got any idea how i change these titles?



    Thanks










    share|improve this question



























      2












      2








      2








      I've seen loads of example of how to re-order / change the navigation and page with the WooCommerce my account dashboard. But i can't for the life of me work out how to change the main titles for each section (My Account, Orders, Downloads, Addresses etc).



      I've searched through the templates but no joy. I've tried using conditional php comments to echo the titles for the correct page. But it doesn't work because my account section uses endpoints. I've tried adding a filter, but no joy. Anyone got any idea how i change these titles?



      Thanks










      share|improve this question
















      I've seen loads of example of how to re-order / change the navigation and page with the WooCommerce my account dashboard. But i can't for the life of me work out how to change the main titles for each section (My Account, Orders, Downloads, Addresses etc).



      I've searched through the templates but no joy. I've tried using conditional php comments to echo the titles for the correct page. But it doesn't work because my account section uses endpoints. I've tried adding a filter, but no joy. Anyone got any idea how i change these titles?



      Thanks







      php wordpress woocommerce title account






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 22 '18 at 23:21









      LoicTheAztec

      87.7k1364101




      87.7k1364101










      asked Nov 22 '18 at 21:15









      alexgomyalexgomy

      11611




      11611
























          2 Answers
          2






          active

          oldest

          votes


















          2














          It can be done using the composite filter hook woocommerce_endpoint_{$endpoint}_title.



          For example if you need to change the My Account "** Account details**" title you will use (where the endpoint is edit-account):



          add_filter( 'woocommerce_endpoint_edit-account_title', 'change_my_account_edit_account_title' );
          function change_my_account_edit_account_title( $title, $endpoint ) {
          $title = __( "Edit your account details", "woocommerce" );

          return $title;
          }


          Code goes in function.php file of your active child theme (or active theme). Tested and works.



          enter image description here






          share|improve this answer


























          • Thanks for posting so others can see. I finally worked out there was a filter for editing endpoint titles.

            – alexgomy
            Nov 23 '18 at 9:27






          • 1





            $items is not even in the scope, so it will not return variable undefined error?????

            – Sahil
            Jan 28 at 12:12











          • Where is $items?

            – Brett
            yesterday











          • @Brett Sorry that was a mistake… Updated.

            – LoicTheAztec
            yesterday



















          0














          Found I can do using woo_endpoint_title filter.






          share|improve this answer
























          • Sorry but your answer is wrong as this is not the right hook to be used…

            – LoicTheAztec
            Nov 22 '18 at 23:21











          • Ahh i see so i should be using the correct filter 'woocommerce_endpoint_edit-account_title' and change to match the correct endpoint. Do you know how to change the main account page title? /my-account/ because this page doesn't have an endpoint? See here: gomy.co.uk/my-account-title.jpg

            – alexgomy
            Dec 3 '18 at 9:10











          • "My account" is not an end point but a page title that you can set in the backend Wordpress pages changing the title name of your page. Be sure after that it's yet selected in Woocommerce > settings > Advanced (You will also see there all the end points). Also you might could delete this answer as it's not useful to the community.

            – LoicTheAztec
            Dec 3 '18 at 9:23













          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          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: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          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
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53438063%2fchanging-the-titles-on-my-account-pages-in-woocommerce%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          It can be done using the composite filter hook woocommerce_endpoint_{$endpoint}_title.



          For example if you need to change the My Account "** Account details**" title you will use (where the endpoint is edit-account):



          add_filter( 'woocommerce_endpoint_edit-account_title', 'change_my_account_edit_account_title' );
          function change_my_account_edit_account_title( $title, $endpoint ) {
          $title = __( "Edit your account details", "woocommerce" );

          return $title;
          }


          Code goes in function.php file of your active child theme (or active theme). Tested and works.



          enter image description here






          share|improve this answer


























          • Thanks for posting so others can see. I finally worked out there was a filter for editing endpoint titles.

            – alexgomy
            Nov 23 '18 at 9:27






          • 1





            $items is not even in the scope, so it will not return variable undefined error?????

            – Sahil
            Jan 28 at 12:12











          • Where is $items?

            – Brett
            yesterday











          • @Brett Sorry that was a mistake… Updated.

            – LoicTheAztec
            yesterday
















          2














          It can be done using the composite filter hook woocommerce_endpoint_{$endpoint}_title.



          For example if you need to change the My Account "** Account details**" title you will use (where the endpoint is edit-account):



          add_filter( 'woocommerce_endpoint_edit-account_title', 'change_my_account_edit_account_title' );
          function change_my_account_edit_account_title( $title, $endpoint ) {
          $title = __( "Edit your account details", "woocommerce" );

          return $title;
          }


          Code goes in function.php file of your active child theme (or active theme). Tested and works.



          enter image description here






          share|improve this answer


























          • Thanks for posting so others can see. I finally worked out there was a filter for editing endpoint titles.

            – alexgomy
            Nov 23 '18 at 9:27






          • 1





            $items is not even in the scope, so it will not return variable undefined error?????

            – Sahil
            Jan 28 at 12:12











          • Where is $items?

            – Brett
            yesterday











          • @Brett Sorry that was a mistake… Updated.

            – LoicTheAztec
            yesterday














          2












          2








          2







          It can be done using the composite filter hook woocommerce_endpoint_{$endpoint}_title.



          For example if you need to change the My Account "** Account details**" title you will use (where the endpoint is edit-account):



          add_filter( 'woocommerce_endpoint_edit-account_title', 'change_my_account_edit_account_title' );
          function change_my_account_edit_account_title( $title, $endpoint ) {
          $title = __( "Edit your account details", "woocommerce" );

          return $title;
          }


          Code goes in function.php file of your active child theme (or active theme). Tested and works.



          enter image description here






          share|improve this answer















          It can be done using the composite filter hook woocommerce_endpoint_{$endpoint}_title.



          For example if you need to change the My Account "** Account details**" title you will use (where the endpoint is edit-account):



          add_filter( 'woocommerce_endpoint_edit-account_title', 'change_my_account_edit_account_title' );
          function change_my_account_edit_account_title( $title, $endpoint ) {
          $title = __( "Edit your account details", "woocommerce" );

          return $title;
          }


          Code goes in function.php file of your active child theme (or active theme). Tested and works.



          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited yesterday

























          answered Nov 22 '18 at 23:20









          LoicTheAztecLoicTheAztec

          87.7k1364101




          87.7k1364101













          • Thanks for posting so others can see. I finally worked out there was a filter for editing endpoint titles.

            – alexgomy
            Nov 23 '18 at 9:27






          • 1





            $items is not even in the scope, so it will not return variable undefined error?????

            – Sahil
            Jan 28 at 12:12











          • Where is $items?

            – Brett
            yesterday











          • @Brett Sorry that was a mistake… Updated.

            – LoicTheAztec
            yesterday



















          • Thanks for posting so others can see. I finally worked out there was a filter for editing endpoint titles.

            – alexgomy
            Nov 23 '18 at 9:27






          • 1





            $items is not even in the scope, so it will not return variable undefined error?????

            – Sahil
            Jan 28 at 12:12











          • Where is $items?

            – Brett
            yesterday











          • @Brett Sorry that was a mistake… Updated.

            – LoicTheAztec
            yesterday

















          Thanks for posting so others can see. I finally worked out there was a filter for editing endpoint titles.

          – alexgomy
          Nov 23 '18 at 9:27





          Thanks for posting so others can see. I finally worked out there was a filter for editing endpoint titles.

          – alexgomy
          Nov 23 '18 at 9:27




          1




          1





          $items is not even in the scope, so it will not return variable undefined error?????

          – Sahil
          Jan 28 at 12:12





          $items is not even in the scope, so it will not return variable undefined error?????

          – Sahil
          Jan 28 at 12:12













          Where is $items?

          – Brett
          yesterday





          Where is $items?

          – Brett
          yesterday













          @Brett Sorry that was a mistake… Updated.

          – LoicTheAztec
          yesterday





          @Brett Sorry that was a mistake… Updated.

          – LoicTheAztec
          yesterday













          0














          Found I can do using woo_endpoint_title filter.






          share|improve this answer
























          • Sorry but your answer is wrong as this is not the right hook to be used…

            – LoicTheAztec
            Nov 22 '18 at 23:21











          • Ahh i see so i should be using the correct filter 'woocommerce_endpoint_edit-account_title' and change to match the correct endpoint. Do you know how to change the main account page title? /my-account/ because this page doesn't have an endpoint? See here: gomy.co.uk/my-account-title.jpg

            – alexgomy
            Dec 3 '18 at 9:10











          • "My account" is not an end point but a page title that you can set in the backend Wordpress pages changing the title name of your page. Be sure after that it's yet selected in Woocommerce > settings > Advanced (You will also see there all the end points). Also you might could delete this answer as it's not useful to the community.

            – LoicTheAztec
            Dec 3 '18 at 9:23


















          0














          Found I can do using woo_endpoint_title filter.






          share|improve this answer
























          • Sorry but your answer is wrong as this is not the right hook to be used…

            – LoicTheAztec
            Nov 22 '18 at 23:21











          • Ahh i see so i should be using the correct filter 'woocommerce_endpoint_edit-account_title' and change to match the correct endpoint. Do you know how to change the main account page title? /my-account/ because this page doesn't have an endpoint? See here: gomy.co.uk/my-account-title.jpg

            – alexgomy
            Dec 3 '18 at 9:10











          • "My account" is not an end point but a page title that you can set in the backend Wordpress pages changing the title name of your page. Be sure after that it's yet selected in Woocommerce > settings > Advanced (You will also see there all the end points). Also you might could delete this answer as it's not useful to the community.

            – LoicTheAztec
            Dec 3 '18 at 9:23
















          0












          0








          0







          Found I can do using woo_endpoint_title filter.






          share|improve this answer













          Found I can do using woo_endpoint_title filter.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 22 '18 at 22:46









          alexgomyalexgomy

          11611




          11611













          • Sorry but your answer is wrong as this is not the right hook to be used…

            – LoicTheAztec
            Nov 22 '18 at 23:21











          • Ahh i see so i should be using the correct filter 'woocommerce_endpoint_edit-account_title' and change to match the correct endpoint. Do you know how to change the main account page title? /my-account/ because this page doesn't have an endpoint? See here: gomy.co.uk/my-account-title.jpg

            – alexgomy
            Dec 3 '18 at 9:10











          • "My account" is not an end point but a page title that you can set in the backend Wordpress pages changing the title name of your page. Be sure after that it's yet selected in Woocommerce > settings > Advanced (You will also see there all the end points). Also you might could delete this answer as it's not useful to the community.

            – LoicTheAztec
            Dec 3 '18 at 9:23





















          • Sorry but your answer is wrong as this is not the right hook to be used…

            – LoicTheAztec
            Nov 22 '18 at 23:21











          • Ahh i see so i should be using the correct filter 'woocommerce_endpoint_edit-account_title' and change to match the correct endpoint. Do you know how to change the main account page title? /my-account/ because this page doesn't have an endpoint? See here: gomy.co.uk/my-account-title.jpg

            – alexgomy
            Dec 3 '18 at 9:10











          • "My account" is not an end point but a page title that you can set in the backend Wordpress pages changing the title name of your page. Be sure after that it's yet selected in Woocommerce > settings > Advanced (You will also see there all the end points). Also you might could delete this answer as it's not useful to the community.

            – LoicTheAztec
            Dec 3 '18 at 9:23



















          Sorry but your answer is wrong as this is not the right hook to be used…

          – LoicTheAztec
          Nov 22 '18 at 23:21





          Sorry but your answer is wrong as this is not the right hook to be used…

          – LoicTheAztec
          Nov 22 '18 at 23:21













          Ahh i see so i should be using the correct filter 'woocommerce_endpoint_edit-account_title' and change to match the correct endpoint. Do you know how to change the main account page title? /my-account/ because this page doesn't have an endpoint? See here: gomy.co.uk/my-account-title.jpg

          – alexgomy
          Dec 3 '18 at 9:10





          Ahh i see so i should be using the correct filter 'woocommerce_endpoint_edit-account_title' and change to match the correct endpoint. Do you know how to change the main account page title? /my-account/ because this page doesn't have an endpoint? See here: gomy.co.uk/my-account-title.jpg

          – alexgomy
          Dec 3 '18 at 9:10













          "My account" is not an end point but a page title that you can set in the backend Wordpress pages changing the title name of your page. Be sure after that it's yet selected in Woocommerce > settings > Advanced (You will also see there all the end points). Also you might could delete this answer as it's not useful to the community.

          – LoicTheAztec
          Dec 3 '18 at 9:23







          "My account" is not an end point but a page title that you can set in the backend Wordpress pages changing the title name of your page. Be sure after that it's yet selected in Woocommerce > settings > Advanced (You will also see there all the end points). Also you might could delete this answer as it's not useful to the community.

          – LoicTheAztec
          Dec 3 '18 at 9:23




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • 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%2fstackoverflow.com%2fquestions%2f53438063%2fchanging-the-titles-on-my-account-pages-in-woocommerce%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

          Create new schema in PostgreSQL using DBeaver

          Deepest pit of an array with Javascript: test on Codility

          Costa Masnaga