diff --git a/class/class.cnv_protection_txt.php b/class/class.conv_protection_txt.php similarity index 69% rename from class/class.cnv_protection_txt.php rename to class/class.conv_protection_txt.php index c905be4..4470ba2 100644 --- a/class/class.cnv_protection_txt.php +++ b/class/class.conv_protection_txt.php @@ -3,9 +3,9 @@ if ( ! defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly -if ( ! class_exists( 'cnv_protection_txt' ) ) { +if ( ! class_exists( 'conv_protection_txt' ) ) { - class cnv_protection_txt { + class conv_protection_txt { public function __construct() { add_action( 'admin_menu', array( $this, 'add_pages' ) ); @@ -27,17 +27,17 @@ if ( ! class_exists( 'cnv_protection_txt' ) ) { } public function show_text_option_page() { - $update_option = filter_input( INPUT_POST, '_cnv_protect_options', FILTER_SANITIZE_STRING, FILTER_REQUIRE_ARRAY ); + $update_option = filter_input( INPUT_POST, 'conv_protection_options', FILTER_SANITIZE_STRING, FILTER_REQUIRE_ARRAY ); if ( ! empty( $update_option ) ) { - check_admin_referer( 'cnv_options' ); - update_option( '_cnv_protect_options', $update_option ); - include_once cnv_protection_txt_settings::TEMPLATE_DIR . 'success.php'; + check_admin_referer( 'conv_options' ); + update_option( 'conv_protection_options', $update_option ); + include_once conv_protection_txt_settings::TEMPLATE_DIR . 'success.php'; } - include_once cnv_protection_txt_settings::TEMPLATE_DIR . 'cnv_protection_txt_form.php'; + include_once conv_protection_txt_settings::TEMPLATE_DIR . 'conv_protection_txt_form.php'; } public function edit_protected_word( $text ) { - $opt = get_option( '_cnv_protect_options' ); + $opt = get_option( 'conv_protection_options' ); if ( isset( $opt['flag'] ) && $opt['flag'] == 2 ) { return '%s'; } @@ -47,21 +47,21 @@ if ( ! class_exists( 'cnv_protection_txt' ) ) { //パスワード保護時のメッセージ public function protect_password_form( $form_text ): string { - $opt = get_option( '_cnv_protect_options' ); + $opt = get_option( 'conv_protection_options' ); if ( isset( $opt['text'] ) && ! empty( $opt['text'] ) ) { $alert_text = $opt['text']; } else { - $alert_text = cnv_protection_txt_settings::ALERT_TEXT; + $alert_text = conv_protection_txt_settings::ALERT_TEXT; } if ( isset( $opt['label'] ) && ! empty( $opt['label'] ) ) { $btn_label = $opt['label'] . ' : '; } else { - $btn_label = cnv_protection_txt_settings::BTN_LABEL . ' : '; + $btn_label = conv_protection_txt_settings::BTN_LABEL . ' : '; } if ( isset( $opt['btn'] ) && ! empty( $opt['btn'] ) ) { $btn_text = $opt['btn']; } else { - $btn_text = cnv_protection_txt_settings::BTN_TEXT; + $btn_text = conv_protection_txt_settings::BTN_TEXT; } return ' diff --git a/class/cnv_protection_txt_settings.php b/class/conv_protection_txt_settings.php similarity index 79% rename from class/cnv_protection_txt_settings.php rename to class/conv_protection_txt_settings.php index 7aa4309..8a83b5f 100644 --- a/class/cnv_protection_txt_settings.php +++ b/class/conv_protection_txt_settings.php @@ -4,9 +4,9 @@ if ( ! defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly -if ( ! class_exists( 'cnv_protection_txt_settings' ) ) { +if ( ! class_exists( 'conv_protection_txt_settings' ) ) { - class cnv_protection_txt_settings{ + class conv_protection_txt_settings{ const ALERT_TEXT = 'このコンテンツはパスワードで保護されています。閲覧するには以下にパスワードを入力してください。'; const BTN_LABEL = 'パスワード'; diff --git a/convert-protection-text.php b/convert-protection-text.php index 76563f8..858046f 100644 --- a/convert-protection-text.php +++ b/convert-protection-text.php @@ -22,7 +22,11 @@ License: GPLv2 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -include_once __DIR__ . '/class/cnv_protection_txt_settings.php'; -include_once __DIR__ . '/class/class.cnv_protection_txt.php'; +if ( ! defined( 'ABSPATH' ) ) { + exit; +} // Exit if accessed directly -new cnv_protection_txt; \ No newline at end of file +include_once __DIR__ . '/class/conv_protection_txt_settings.php'; +include_once __DIR__ . '/class/class.conv_protection_txt.php'; + +new conv_protection_txt; \ No newline at end of file diff --git a/template/cnv_protection_txt_form.php b/template/conv_protection_txt_form.php similarity index 59% rename from template/cnv_protection_txt_form.php rename to template/conv_protection_txt_form.php index def38b4..f27535f 100644 --- a/template/cnv_protection_txt_form.php +++ b/template/conv_protection_txt_form.php @@ -1,13 +1,18 @@ +

限定公開ページテキストカスタマイズ

@@ -15,17 +20,17 @@ @@ -33,21 +38,21 @@ diff --git a/template/success.php b/template/success.php index c91135f..725d1c4 100644 --- a/template/success.php +++ b/template/success.php @@ -1 +1,6 @@ +

設定を保存しました

diff --git a/uninstall.php b/uninstall.php index c9dea9c..4e592ac 100644 --- a/uninstall.php +++ b/uninstall.php @@ -5,4 +5,4 @@ if (!defined('WP_UNINSTALL_PLUGIN')) { } // オプション設定の削除 -delete_option('_cnv_protect_options'); \ No newline at end of file +delete_option('conv_protection_options'); \ No newline at end of file
メッセージ -
ボタンラベル -
ボタン名 -