update_meta('wpu_' . $meta_key, maybe_serialize($meta_value)); /** * Explicitly returns null so we don't forget that * returning anything else will prevent meta data from being saved. */ return null; } /** * Injects the compatibility panels to products Advanced Options. * * @since 2.0.0 * * @param array $sections List of tabbed widget sections. * @param \WP_Ultimo\Models\Product $object The model being edited. * @return array */ public function add_legacy_section($sections, $object) { $sections['legacy_options_core'] = array( 'title' => __('Legacy Options', 'wp-ultimo'), 'desc' => __('Options used by old 1.X versions. ', 'wp-ultimo'), 'icon' => 'dashicons-wu-spreadsheet', 'state' => array( 'legacy_options' => $object->get_legacy_options(), ), 'fields' => array( 'legacy_options' => array( 'type' => 'toggle', 'value' => $object->get_legacy_options(), 'title' => __('Toggle Legacy Options', 'wp-ultimo'), 'desc' => __('Toggle this option to edit legacy options.', 'wp-ultimo'), 'html_attr' => array( 'v-model' => 'legacy_options', ), ), 'featured_plan' => array( 'type' => 'toggle', 'value' => $object->is_featured_plan(), 'title' => __('Featured Plan', 'wp-ultimo'), 'desc' => __('Toggle this option to mark this product as featured on the legacy pricing tables.', 'wp-ultimo'), 'wrapper_html_attr' => array( 'v-show' => 'legacy_options', ), ), 'feature_list' => array( 'type' => 'textarea', 'title' => __('Features List', 'wp-ultimo'), 'placeholder' => __('E.g. Feature 1', 'wp-ultimo') . PHP_EOL . __('Feature 2', 'wp-ultimo'), 'desc' => __('Add a feature per line. These will be shown on the pricing tables.', 'wp-ultimo'), 'value' => $object->get_feature_list(), 'wrapper_html_attr' => array( 'v-show' => 'legacy_options', ), 'html_attr' => array( 'rows' => 6, ), ), ), ); return $sections; } }