Files
Convert_Protection_Text/template/cnv_protection_txt_form.php
T
2021-06-30 18:14:38 +09:00

57 lines
2.4 KiB
PHP

<div class="wrap">
<h2>アクセス権限ページ設定</h2>
<form action="" method="post">
<?php
wp_nonce_field( 'cnv_options' );
$opt = get_option( '_cnv_protect_options' );
$show_radio = $opt['flag'] ?? 1;
$show_text = $opt['text'] ?? cnv_protection_txt_settings::ALERT_TEXT;
$show_label = $opt['label'] ?? cnv_protection_txt_settings::BTN_LABEL;
$show_btn = $opt['btn'] ?? cnv_protection_txt_settings::BTN_TEXT;
?>
<table class="form-table">
<tr valign="top">
<th scope="row"><label for="inputtext">保護中</label></th>
<td>
<?php if ( $show_radio == 2 ) : ?>
<label>
<input type="radio" name="_cnv_protect_options[flag]" value="1">表示
</label>
<label>
<input type="radio" name="_cnv_protect_options[flag]" value="2" checked>非表示
</label>
<?php elseif ( $show_radio == 1 ): ?>
<label>
<input type="radio" name="_cnv_protect_options[flag]" value="1" checked>表示
</label>
<label>
<input type="radio" name="_cnv_protect_options[flag]" value="2">非表示
</label>
<?php endif; ?>
</td>
</tr>
<tr valign="top">
<th scope="row">メッセージ</th>
<td>
<textarea name="_cnv_protect_options[text]" rows="4"
cols="60"><?php echo esc_attr( $show_text ); ?></textarea>
</td>
</tr>
<tr valign="top">
<th scope="row">ボタンラベル</th>
<td>
<input type="text" name="_cnv_protect_options[label]"
value="<?php echo esc_attr( $show_label ); ?>">
</td>
</tr>
<tr valign="top">
<th scope="row">ボタン名</th>
<td>
<input type="text" name="_cnv_protect_options[btn]"
value="<?php echo esc_attr( $show_btn ); ?>">
</td>
</tr>
</table>
<p class="submit"><input type="submit" name="Submit" class="button-primary" value="変更を保存"/></p>
</form>
</div>