diff --git a/archive-post-order-plus.php b/archive-post-order-plus.php index 1ad5203..76ec47e 100644 --- a/archive-post-order-plus.php +++ b/archive-post-order-plus.php @@ -22,18 +22,9 @@ License: GPLv2 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -/** - * TODO: - 1)カテゴリーのソート用カスタムフィールド取得と設定 - ・保存しているタームIDと投稿が属するタームIDが一致する場合、管理画面に表示する - class.apop.apop_post.php、setting_post_custom_field.php - * 2)uninstall.php - * 投稿とタクソノミーのカスタムフィールド削除方法修正 - * ・delete_post_meta_by_key()を廃止し、WP_QUERYに変更する - */ - define( 'APOP_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); define( 'APOP_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); +define( 'APOP_CUSTOM_FIELD_PREFIX', '_apop_postorder_' ); //メイン処理のクラスをインスタンス化 require_once __DIR__ . '/class/class.apop.order.php'; diff --git a/class/class.apop.apop_post.php b/class/class.apop.apop_post.php index b950f84..cf50787 100644 --- a/class/class.apop.apop_post.php +++ b/class/class.apop.apop_post.php @@ -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 ] ?? '' ); } } } diff --git a/class/class.apop.apop_ui.php b/class/class.apop.apop_ui.php index 2d0f6fd..524279e 100644 --- a/class/class.apop.apop_ui.php +++ b/class/class.apop.apop_ui.php @@ -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 '
並べ替えをカスタマイズする' . $str . 'は選択されていません。
'; + return '並べ替えをカスタマイズする' . $str . 'は選択されていません。
'; } public static function none_registered_alert_msg(): string { diff --git a/css/apop-style.css b/css/apop-style.css index 54598c3..6a1ef4e 100644 --- a/css/apop-style.css +++ b/css/apop-style.css @@ -131,7 +131,11 @@ dl.apop_setting_list_dd dd input { background: #fff; cursor: move; color: #4b4b4b; - border: 1px solid #ccc; + border-bottom: 1px solid #ccc; +} + +.enable_box .product-list { + padding: 1em 0; } .search_normal_sort .product-list { @@ -140,6 +144,10 @@ dl.apop_setting_list_dd dd input { .search_normal_sort .product-list-type-label, .disable_box .product-list-type-label { + width: calc((100%) - 60px); +} + +.enable_box .product-list-type-label { width: calc(100% / 2); } @@ -218,7 +226,7 @@ dl.apop_setting_list_dd dd input { } .disable_box .product-list { - width: calc((100% / 2) - 20px); + width: calc((100% / 2) - 15px); display: flex; cursor: default; } @@ -235,12 +243,41 @@ dl.apop_setting_list_dd dd input { padding-left: .5em; } +.enable_box { + margin-bottom: 1em; +} + +.enable_box, +.disable_box { + padding: .5em; + border: 1px solid #ccc; +} + +.enable_box h4 { + margin: .5em 0 0; +} + +.disable_box h4 { + margin: .5em 0; +} + @media only screen and (max-width: 1264px) { + .enable_box .product-list, + .disable_box .product-list { + display: block; + } + .search_normal_sort .product-list { display: block; } - .search_normal_sort .product-list-type-label { + .search_normal_sort .product-list-type-label, + .disable_box .product-list-type-label { + width: 100%; + display: block; + } + + .search_normal_sort .product-list-sort-type { width: 100%; margin-bottom: 1em; display: block; diff --git a/template/order.php b/template/order.php index 72103de..96c662c 100644 --- a/template/order.php +++ b/template/order.php @@ -29,10 +29,12 @@ $submit_type = APOP_UI::input_post_filter( 'apop_submit_type', 'str' );