WP PLUGIN プラグイン削除時のパラメータ削除とCSS調整
・投稿のソート用カスタムフィールドのキーについて、他システム等の競合を避け且つアンインストール時に前方一致で削除可能となるよう接頭辞を追加(接頭辞はプログラム側で持つため、管理画面上は表示しない) ・プラグイン削除時、オプションやカスタムフィールドを全削除するよう修正 ・標準+カスタムフィールドソートの横並びを修正
This commit is contained in:
@@ -110,7 +110,7 @@ if ( ! class_exists( 'APOP_POST' ) ) {
|
||||
private function get_custom_field_data( $custom_filed_name ) {
|
||||
global $post;
|
||||
|
||||
return get_post_meta( $post->ID, $custom_filed_name, true );
|
||||
return get_post_meta( $post->ID, APOP_CUSTOM_FIELD_PREFIX . $custom_filed_name, true );
|
||||
}
|
||||
|
||||
// カスタムフィールドの値を保存
|
||||
@@ -118,8 +118,9 @@ if ( ! class_exists( 'APOP_POST' ) ) {
|
||||
$this->get_update_meta_fields();
|
||||
if ( count( $this->name_keys ) > 0 ) {
|
||||
foreach ( $this->name_keys as $name_key ) {
|
||||
update_post_meta( $post_id, $name_key, $_POST[ $name_key ] ?? '' );
|
||||
update_post_meta( $post_id, $name_key, $_POST[ $name_key ] ?? '' );
|
||||
$save_key = APOP_CUSTOM_FIELD_PREFIX . $name_key;
|
||||
update_post_meta( $post_id, $save_key, $_POST[ $save_key ] ?? '' );
|
||||
update_post_meta( $post_id, $save_key, $_POST[ $save_key ] ?? '' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -447,7 +447,7 @@ value="meta_value_num"' . self::set_search_normal_checked( $value_type, 'meta_va
|
||||
}
|
||||
|
||||
public static function create_none_select_msg( $str ): string {
|
||||
return '<p>並べ替えをカスタマイズする' . $str . 'は選択されていません。</p>';
|
||||
return '<p class="no_registered_exp">並べ替えをカスタマイズする' . $str . 'は選択されていません。</p>';
|
||||
}
|
||||
|
||||
public static function none_registered_alert_msg(): string {
|
||||
|
||||
Reference in New Issue
Block a user