{"id":5495,"date":"2023-12-31T10:55:59","date_gmt":"2023-12-31T10:55:59","guid":{"rendered":"https:\/\/artursamenezes.com\/site\/?page_id=5495"},"modified":"2023-12-31T11:17:58","modified_gmt":"2023-12-31T11:17:58","slug":"artur-solucao-perfeita-para-restringir-contact-form-7-a-nao-logados","status":"publish","type":"page","link":"https:\/\/artursamenezes.com\/site\/artur-solucao-perfeita-para-restringir-contact-form-7-a-nao-logados\/","title":{"rendered":"ARTUR &#8211; Solu\u00e7\u00e3o perfeita para restringir Contact Form 7 a n\u00e3o logados"},"content":{"rendered":"<h4><span style=\"text-decoration: underline;\"><span style=\"color: #0050a0; text-decoration: underline;\">ARTUR &#8211; Solu\u00e7\u00e3o perfeita para restringir Contact Form 7 a n\u00e3o logados<\/span><\/span><\/h4>\n<ul>\n<li><span style=\"color: #008000;\">Admintindo que o slug (URL, parte final) da p\u00e1gina de contato \u00e9: <span style=\"color: #c29500;\"><strong>contato-proposta-orcamento<\/strong><\/span><\/span><\/li>\n<\/ul>\n<p>Arquivo: <strong>TEMA PRINCIPAL (Template)<\/strong><\/p>\n<p>\/themes\/NomeDoTema\/<span style=\"color: #993300;\"><strong>page.php<\/strong><\/span><\/p>\n<p>C\u00f3digo:<\/p>\n<p>\/* ARTUR &#8212; Restri\u00e7\u00e3o CF7 para n\u00e3o logados *\/<br \/>\n <span style=\"color: #008000;\"><strong><span style=\"font-family: courier new, courier, monospace;\">if ( is_page( &#8216;<span style=\"color: #c29500;\">contato-proposta-orcamento<\/span>&#8216; ) ) {<\/span><\/strong><\/span><br \/>\n <span style=\"color: #008000;\"><strong> <span style=\"font-family: courier new, courier, monospace;\"> if ( ! is_user_logged_in() ) {<\/span><\/strong><\/span><br \/>\n <span style=\"color: #008000;\"><strong> <span style=\"font-family: courier new, courier, monospace;\"> auth_redirect();<\/span><\/strong><\/span><br \/>\n <span style=\"color: #008000;\"><strong> <span style=\"font-family: courier new, courier, monospace;\"> }<\/span><\/strong><\/span><br \/>\n <span style=\"color: #008000;\"><strong> <span style=\"font-family: courier new, courier, monospace;\"> }<\/span><\/strong><\/span><\/p>\n<p>&nbsp;<\/p>\n<hr style=\"height: 15px; border-width: 0; color: green; background-color: lightgreen;\" \/>\n<p>H\u00e1 sugest\u00e3o para o <strong>TEMA-FILHO<\/strong><\/p>\n<p>Arquivo:<\/p>\n<p><strong><span style=\"color: #993300;\">functions.php<\/span><\/strong><\/p>\n<p>C\u00f3digo:<\/p>\n<p><span style=\"color: #008000;\"><strong><span style=\"font-family: courier new, courier, monospace;\">function restrict_contact_page_access() {<\/span><\/strong><\/span><br \/>\n <span style=\"color: #008000;\"><strong> <span style=\"font-family: courier new, courier, monospace;\"> if ( is_page( &#8216;<span style=\"color: #c29500;\">contato-proposta-orcamento<\/span>&#8216; ) &amp;&amp; ! is_user_logged_in() ) {<\/span><\/strong><\/span><br \/>\n <span style=\"color: #008000;\"><strong> <span style=\"font-family: courier new, courier, monospace;\"> auth_redirect();<\/span><\/strong><\/span><br \/>\n <span style=\"color: #008000;\"><strong> <span style=\"font-family: courier new, courier, monospace;\"> }<\/span><\/strong><\/span><br \/>\n <span style=\"color: #008000;\"><strong> <span style=\"font-family: courier new, courier, monospace;\"> }<\/span><\/strong><\/span><br \/>\n <span style=\"color: #008000;\"><strong> <span style=\"font-family: courier new, courier, monospace;\"> add_action( &#8216;template_redirect&#8217;, &#8216;restrict_contact_page_access&#8217; );<\/span><\/strong><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>ARTUR &#8211; Solu\u00e7\u00e3o perfeita para restringir Contact Form 7 a n\u00e3o logados Admintindo que o slug (URL, parte final) da p\u00e1gina de contato \u00e9: contato-proposta-orcamento Arquivo: TEMA PRINCIPAL (Template) \/themes\/NomeDoTema\/page.php C\u00f3digo: \/* ARTUR &#8212; Restri\u00e7\u00e3o CF7 para n\u00e3o logados *\/ if ( is_page( &#8216;contato-proposta-orcamento&#8216; ) ) { if ( ! is_user_logged_in() ) { auth_redirect(); }&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/artursamenezes.com\/site\/wp-json\/wp\/v2\/pages\/5495"}],"collection":[{"href":"https:\/\/artursamenezes.com\/site\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/artursamenezes.com\/site\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/artursamenezes.com\/site\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/artursamenezes.com\/site\/wp-json\/wp\/v2\/comments?post=5495"}],"version-history":[{"count":11,"href":"https:\/\/artursamenezes.com\/site\/wp-json\/wp\/v2\/pages\/5495\/revisions"}],"predecessor-version":[{"id":5508,"href":"https:\/\/artursamenezes.com\/site\/wp-json\/wp\/v2\/pages\/5495\/revisions\/5508"}],"wp:attachment":[{"href":"https:\/\/artursamenezes.com\/site\/wp-json\/wp\/v2\/media?parent=5495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}