<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Modificare testo della pagina di protezione]]></title><description><![CDATA[<p dir="auto">Ciao a tutti,</p>
<p dir="auto">stavo provando a modificare il testo standard che appare quando proteggi una pagina con la password. Il testo in questione è: "This post is password protected. To view it please enter your password below:".</p>
<p dir="auto">Ho provato ad aggiungere al file "functions.php" i seguenti codici:</p>
<pre><code class="language-php">function my_password_form() {
    global $post;
    $label = 'pwbox-'.( empty( $post-&gt;ID ) ? rand() : $post-&gt;ID );
    $o = '&lt;form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" method="post"&gt;
    ' . __( "To view this protected post, enter the password below:" ) . '
    &lt;label for="' . $label . '"&gt;' . __( "Password:" ) . ' &lt;/label&gt;&lt;input name="post_password" id="' . $label . '" type="password" size="20" maxlength="20" /&gt;&lt;input type="submit" name="Submit" value="' . esc_attr__( "Submit" ) . '" /&gt;
    &lt;/form&gt;
    ';
    return $o;
}
add_filter( 'the_password_form', 'my_password_form' );
</code></pre>
<p dir="auto">E anche questo:</p>
<pre><code class="language-php">function custom_password_form_text( $text ) {
    $text = str_replace( 'This content is password protected. To view it please enter your password below:', 'your text', $text );
    return $text;
}
add_filter( 'the_password_form', 'custom_password_form_text' );
</code></pre>
<p dir="auto">Ma nessuno dei due funziona. Qualcuno conosce un altro metodo per modificare la scritta?</p>
<p dir="auto">PS: sto usando la versione 4.4.2 di Wordpress</p>
]]></description><link>https://dev.connect.gt/topic/222315/modificare-testo-della-pagina-di-protezione</link><generator>RSS for Node</generator><lastBuildDate>Thu, 26 Nov 2026 02:58:42 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/222315.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 04 Apr 2016 14:41:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Modificare testo della pagina di protezione on Tue, 12 Apr 2016 12:08:54 GMT]]></title><description><![CDATA[<p dir="auto">Probabilmente se ne esce con qeusta action al posto di quelle due:</p>
<pre><code class="language-php">// Password Protected Page Message
function custom_password_form($form) {
  $subs = array(
     '#&lt;p&gt;Il tuo testo abc: Il tuo testo abc&lt;/p&gt;#' =&gt;  '&lt;p&gt;Il tuo testo abc Il tuo testo abc Il tuo testo  abc.&lt;/p&gt;',
    '#&lt;form(.*?)&gt;#' =&gt; '&lt;form$1 class="passwordform"&gt;',
    '#&lt;input(.*?)type="password"(.*?) /&gt;#' =&gt; '&lt;input$1type="password"$2 class="text" /&gt;',
    '#&lt;input(.*?)type="submit"(.*?) /&gt;#' =&gt; '&lt;input$1type="submit"$2 class="button" /&gt;'
  );

  echo preg_replace(array_keys($subs), array_values($subs), $form);
}
add_filter('the_password_form', 'custom_password_form');
</code></pre>
<p dir="auto">non testato, magari aiuta.</p>
]]></description><link>https://dev.connect.gt/post/1220341</link><guid isPermaLink="true">https://dev.connect.gt/post/1220341</guid><dc:creator><![CDATA[salvatore79]]></dc:creator><pubDate>Tue, 12 Apr 2016 12:08:54 GMT</pubDate></item><item><title><![CDATA[Reply to Modificare testo della pagina di protezione on Fri, 08 Apr 2016 11:25:05 GMT]]></title><description><![CDATA[<p dir="auto">Ciao, hai provato a vedere se il tema ha dei file di lingua? Solitamente sono nella cartella language e li riconosci dall'estensione .mo e .po (es: en_EN.po/.mo)</p>
]]></description><link>https://dev.connect.gt/post/1220340</link><guid isPermaLink="true">https://dev.connect.gt/post/1220340</guid><dc:creator><![CDATA[pikadilly]]></dc:creator><pubDate>Fri, 08 Apr 2016 11:25:05 GMT</pubDate></item></channel></rss>