'First SKU selling price', 'minimum' => 'Lowest SKU selling price', 'maximum' => 'Highest SKU selling price', ); } /** * 構造化データの設定の初期化. */ public function initialize_data() { global $usces; $options = get_option( 'usces_ex', array() ); $options['system']['structured_data_product']['status'] = ( ! isset( $options['system']['structured_data_product']['status'] ) ) ? 0 : (int) $options['system']['structured_data_product']['status']; $options['system']['structured_data_product']['default_price'] = ( ! isset( $options['system']['structured_data_product']['default_price'] ) ) ? 'first' : $options['system']['structured_data_product']['default_price']; update_option( 'usces_ex', $options ); self::$opts = $options['system']['structured_data_product']; self::$default_option = array( 'status' => array( 0, 1 ), 'default_price' => array( 'first', 'minimum', 'maximum' ), ); } /** * 構造化データの設定保存. */ public function save_data() { global $usces; if ( isset( $_POST['usces_structured_data_product_option_update'] ) ) { check_admin_referer( 'admin_system', 'wc_nonce' ); if ( ! current_user_can( 'wel_manage_setting' ) ) { wp_die( __( 'You do not have sufficient permissions to access this page.' ) ); } self::$opts['default_price'] = ( isset( $_POST['default_price'] ) ) ? $_POST['default_price'] : 'first'; self::$opts['status'] = ( isset( $_POST['structured_data_product_status'] ) ) ? (int) $_POST['structured_data_product_status'] : 0; $options = get_option( 'usces_ex', array() ); $options['system']['structured_data_product'] = self::$opts; if ( isset( $options['system']['structured_data_product']['error_message'] ) ) { unset( $options['system']['structured_data_product']['error_message'] ); } update_option( 'usces_ex', $options ); } } /** * システム設定 > 拡張機能のフォーム作成. */ public function setting_form() { $status = ( self::$opts['status'] || self::$opts['status'] ) ? '' . __( 'Running', 'usces' ) . '' : '' . __( 'Stopped', 'usces' ) . ''; $colspan = count( self::$default_option['default_price'] ); ?>

/> />
/>