{"id":21753,"date":"2025-07-21T18:19:37","date_gmt":"2025-07-21T22:19:37","guid":{"rendered":"https:\/\/new2.mylpan.cl\/?post_type=wpcode&#038;p=21753"},"modified":"2026-02-09T14:06:25","modified_gmt":"2026-02-09T17:06:25","slug":"fragmento-de-codigo-sin-titulo-copy","status":"publish","type":"post","link":"https:\/\/mylpan.cl\/?p=21753","title":{"rendered":"Fragmento de c\u00f3digo sin t\u00edtulo &#8211; Copy"},"content":{"rendered":"<p>const reemplazosDashboard = setInterval(() => {<br \/>\n  const accountDashboard = document.querySelector(&#8216;ul.account-dashboard&#8217;);<br \/>\n  if (accountDashboard) {<br \/>\n    accountDashboard.querySelectorAll(&#8216;li a&#8217;).forEach(anchor => {<br \/>\n      const title = anchor.getAttribute(&#8216;title&#8217;)?.trim();<\/p>\n<p>      if (title === &#8216;Dashboard&#8217; &#038;&#038; anchor.textContent.trim() === &#8216;Dashboard&#8217;) {<br \/>\n        anchor.textContent = &#8216;Escritorio&#8217;;<br \/>\n      }<br \/>\n      else if (title === &#8216;Orders&#8217; &#038;&#038; anchor.textContent.trim() === &#8216;Orders&#8217;) {<br \/>\n        anchor.textContent = &#8216;Pedidos&#8217;;<br \/>\n      }<br \/>\n      else if (title === &#8216;Downloads&#8217; &#038;&#038; anchor.textContent.trim() === &#8216;Downloads&#8217;) {<br \/>\n        anchor.textContent = &#8216;Descargas&#8217;;<br \/>\n      }<br \/>\n      else if (title === &#8216;Edit Address&#8217; &#038;&#038; anchor.textContent.trim() === &#8216;Edit Address&#8217;) {<br \/>\n        anchor.textContent = &#8216;Editar perfil&#8217;;<br \/>\n      }<br \/>\n      else if (title === &#8216;Account Details&#8217; &#038;&#038; anchor.textContent.trim() === &#8216;Account Details&#8217;) {<br \/>\n        anchor.textContent = &#8216;Mi cuenta&#8217;;<br \/>\n      }<br \/>\n    });<br \/>\n  }<\/p>\n<p>  const tipsAnchor = document.querySelector(&#8216;a.tips&#8217;);<br \/>\n  if (tipsAnchor &#038;&#038; tipsAnchor.textContent.trim() === &#8216;Log Out&#8217;) {<br \/>\n    tipsAnchor.textContent = &#8216;Cerrar sesi\u00f3n&#8217;;<br \/>\n  }<\/p>\n<p>  \/\/ Condici\u00f3n para detener el intervalo cuando ya est\u00e9n reemplazados<br \/>\n  const allReplaced = (<br \/>\n    accountDashboard &#038;&#038;<br \/>\n    Array.from(accountDashboard.querySelectorAll(&#8216;li a&#8217;)).every(anchor => {<br \/>\n      const title = anchor.getAttribute(&#8216;title&#8217;)?.trim();<br \/>\n      const text = anchor.textContent.trim();<br \/>\n      if (title === &#8216;Dashboard&#8217;) return text === &#8216;Escritorio&#8217;;<br \/>\n      if (title === &#8216;Orders&#8217;) return text === &#8216;Pedidos&#8217;;<br \/>\n      if (title === &#8216;Downloads&#8217;) return text === &#8216;Descargas&#8217;;<br \/>\n      if (title === &#8216;Edit Address&#8217;) return text === &#8216;Editar perfil&#8217;;<br \/>\n      if (title === &#8216;Account Details&#8217;) return text === &#8216;Mi cuenta&#8217;;<br \/>\n      return true; \/\/ ignore others<br \/>\n    }) &#038;&#038;<br \/>\n    tipsAnchor &#038;&#038; tipsAnchor.textContent === &#8216;Cerrar sesi\u00f3n&#8217;<br \/>\n  );<\/p>\n<p>  if (allReplaced) {<br \/>\n    clearInterval(reemplazosDashboard);<br \/>\n  }<br \/>\n}, 300);<\/p>\n","protected":false},"excerpt":{"rendered":"<p>const reemplazosDashboard = setInterval(() => { const accountDashboard = document.querySelector(&#8216;ul.account-dashboard&#8217;); if (accountDashboard) { accountDashboard.querySelectorAll(&#8216;li a&#8217;).forEach(anchor => { const title = anchor.getAttribute(&#8216;title&#8217;)?.trim(); if (title === &#8216;Dashboard&#8217; &#038;&#038; anchor.textContent.trim() === &#8216;Dashboard&#8217;) { anchor.textContent = &#8216;Escritorio&#8217;; } else if (title === &#8216;Orders&#8217; &#038;&#038; anchor.textContent.trim() === &#8216;Orders&#8217;) { anchor.textContent = &#8216;Pedidos&#8217;; } else if (title === &#8216;Downloads&#8217; &#038;&#038; anchor.textContent.trim() [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-21753","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/mylpan.cl\/index.php?rest_route=\/wp\/v2\/posts\/21753","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mylpan.cl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mylpan.cl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mylpan.cl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mylpan.cl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=21753"}],"version-history":[{"count":0,"href":"https:\/\/mylpan.cl\/index.php?rest_route=\/wp\/v2\/posts\/21753\/revisions"}],"wp:attachment":[{"href":"https:\/\/mylpan.cl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=21753"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mylpan.cl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=21753"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mylpan.cl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=21753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}