我有一个带有一些选项的选择框。它出现在正常的产品编辑屏幕中,并显示以下代码。
function we_skroutzxml_custom_availability() {
woocommerce_wp_select(
array(
\'id\' => \'we_skroutzxml_custom_availability\',
\'placeholder\' => __(\'Choose\',$this->plugin_slug),
\'label\' => __(\'Availability\',$this->plugin_slug),
\'options\' => array( \'\' => __( \'Default\', $this->plugin_slug ),\'Άμεση παραλαβή / Παράδoση 1 έως 3 ημέρες\' => __( \'Available in store / Delivery 1 to 3 days\', $this->plugin_slug ),\'Παράδοση σε 1 - 3 ημέρες\' => __( \'Delivery 1 to 3 days\', $this->plugin_slug ),\'Παράδοση σε 4 - 10 ημέρες\' => __( \'Delivery 4 to 10 days\', $this->plugin_slug ), \'Κατόπιν Παραγγελίας\' => __( \'Upon order\', $this->plugin_slug ))
));
}
function we_skroutzxml_custom_availability_save_data($post_id) {
$custom_availability = $_POST[\'we_skroutzxml_custom_availability\'];
if ( ! empty( $custom_availability ) ) {
update_post_meta( $post_id, \'we_skroutzxml_custom_availability\',$custom_availability);
}else {
delete_post_meta( $post_id, \'we_skroutzxml_custom_availability\');
}
}
我必须如何在quickedit屏幕中显示并保存它?非常感谢。