WP PLUGIN
・選択カスタムフィールドをオートコンプリートに変更
This commit is contained in:
@@ -346,8 +346,11 @@ value="' . esc_html( $sort_num ) . '">
|
||||
$name_meta_key = '_' . $name_key . '[' . $target_key . '][field][meta_key]';
|
||||
$name_value_type = '_' . $name_key . '[' . $target_key . '][field][value_type]';
|
||||
$name_custom_field_type = '_' . $name_key . '[' . $target_key . '][field][custom_field_type]';
|
||||
$custom_field_val_1 = $custom_field_type == '1' ? $meta_key : '';
|
||||
$custom_field_val_2 = $custom_field_type == '2' ? $meta_key : '';;
|
||||
echo '<div class="sort-custom-field">
|
||||
<div class="sort-custom-field-types"><div class="sort-custom-field-inner-label">
|
||||
<div class="sort-custom-field-types">
|
||||
<div class="sort-custom-field-inner-label">
|
||||
<label>
|
||||
<input type="radio"
|
||||
class="custom-field-type"
|
||||
@@ -359,8 +362,8 @@ value="' . esc_html( $sort_num ) . '">
|
||||
name="' . esc_attr( $name_custom_field_type ) . '"
|
||||
value="2"' . esc_attr( self::set_search_normal_checked( $custom_field_type, '2' ) ) . '>追加</label>
|
||||
</div>';
|
||||
self::set_all_customfield_select( $name_meta_key, $meta_key );
|
||||
echo '<input type="text" class="custom_field_key" name="' . esc_attr( $name_meta_key ) . '" value="' . esc_attr( $meta_key ) . '" required>
|
||||
echo '<input type="text" id="select-custom-field-input" class="custom_field_key_select" name="' . esc_attr( $name_meta_key ) . '" . value="' . esc_attr( $custom_field_val_1 ) . '" required>
|
||||
<input type="text" class="custom_field_key" name="' . esc_attr( $name_meta_key ) . '" value="' . esc_attr( $custom_field_val_2 ) . '" required>
|
||||
</div>
|
||||
<div class="sort-custom-field-inner">
|
||||
<div class="sort-custom-field-inner-label">値タイプ:</div>
|
||||
|
||||
@@ -6,15 +6,18 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
if ( ! class_exists( 'APOP' ) ) {
|
||||
|
||||
require_once __DIR__ . '/../util/apop-order-setting.php';
|
||||
require_once __DIR__ . '/../util/apop-customfield-select.php';
|
||||
|
||||
class APOP {
|
||||
|
||||
use APOP_ORDER_SETTING;
|
||||
use APOP_ORDER_SETTING, CUSTOMFIELD_SELECT;
|
||||
|
||||
const TEMPLATE_DIR = __DIR__ . '/../template/';
|
||||
|
||||
public function __construct() {
|
||||
add_action( 'admin_menu', array( $this, 'add_pages' ) );
|
||||
add_action( 'admin_enqueue_scripts', array( $this, 'set_custom_field_ajax' ) );
|
||||
add_action( 'wp_ajax_set_custom_field', array( $this, 'set_custom_field' ) );
|
||||
}
|
||||
|
||||
public function add_pages() {
|
||||
|
||||
Reference in New Issue
Block a user