WP_PLUGIN パスワード保護ページのテキスト変更
・サニタイズとエスケープ ・完了メッセージの閉じるボタン追加
This commit is contained in:
+13
-10
@@ -30,13 +30,14 @@ class CNV_Protection_Text {
|
||||
}
|
||||
|
||||
public function show_text_option_page() {
|
||||
//$_POST['_cnv_protect_options'])があったら保存
|
||||
if ( isset( $_POST['_cnv_protect_options'] ) ) {
|
||||
$update_option = filter_input( INPUT_POST, '_cnv_protect_options', FILTER_SANITIZE_STRING, FILTER_REQUIRE_ARRAY );
|
||||
if ( ! empty( $update_option ) ) {
|
||||
check_admin_referer( 'cnv_options' );
|
||||
$opt = $_POST['_cnv_protect_options'];
|
||||
update_option( '_cnv_protect_options', $opt );
|
||||
update_option( '_cnv_protect_options', $update_option );
|
||||
?>
|
||||
<div class="updated fade"><p><strong>設定を保存しました</strong></p></div><?php
|
||||
<div id="settings_updated" class="updated notice is-dismissible">
|
||||
<p><strong>設定を保存しました</strong></p>
|
||||
</div><?php
|
||||
}
|
||||
?>
|
||||
<div class="wrap">
|
||||
@@ -76,19 +77,21 @@ class CNV_Protection_Text {
|
||||
<th scope="row">メッセージ</th>
|
||||
<td>
|
||||
<textarea name="_cnv_protect_options[text]" rows="4"
|
||||
cols="60"><?php echo $show_text; ?></textarea>
|
||||
cols="60"><?php echo esc_html( $show_text ); ?></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th scope="row">ボタンラベル</th>
|
||||
<td>
|
||||
<input type="text" name="_cnv_protect_options[label]" value="<?php echo $show_label; ?>">
|
||||
<input type="text" name="_cnv_protect_options[label]"
|
||||
value="<?php echo esc_html( $show_label ); ?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<th scope="row">ボタン名</th>
|
||||
<td>
|
||||
<input type="text" name="_cnv_protect_options[btn]" value="<?php echo $show_btn; ?>">
|
||||
<input type="text" name="_cnv_protect_options[btn]"
|
||||
value="<?php echo esc_html( $show_btn ); ?>">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -127,8 +130,8 @@ class CNV_Protection_Text {
|
||||
}
|
||||
|
||||
return '<form action="' . home_url() . '/wp-login.php?action=postpass" class="post-password-form" method="post">
|
||||
<p>' . nl2br( $alert_text ) . '</p>
|
||||
<p><label for="pwbox">' . $btn_label . '<input name="post_password" id="pwbox" type="password" size="20"></label> <input type="submit" name="Submit" value="' . $btn_text . '"></p></form>';
|
||||
<p>' . nl2br( esc_html( $alert_text ) ) . '</p>
|
||||
<p><label for="pwbox">' . esc_html( $btn_label ) . '<input name="post_password" id="pwbox" type="password" size="20"></label> <input type="submit" name="Submit" value="' . esc_html( $btn_text ) . '"></p></form>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user