File "SettingsDisplayPreparer.php"

Full Path: /home/jlklyejr/public_html/post-date/wp-content/plugins/flexible-shipping/src/WPDesk/FS/TableRate/ShippingMethod/SettingsDisplayPreparer.php
File size: 798 bytes
MIME-type: text/x-php
Charset: utf-8

<?php
/**
 * Class SettingsDisplayPreparer
 *
 * @package WPDesk\FS\TableRate\ShippingMethod
 */

namespace WPDesk\FS\TableRate\ShippingMethod;

use FSVendor\WPDesk\Beacon\Beacon\WooCommerceSettingsFieldsModifier;

/**
 * Can prepare settings fields for display.
 */
class SettingsDisplayPreparer {

	/**
	 * Prepare settings for display.
	 * Ie. set select options when options are from API - prevents unwanted API calls on non settings requests.
	 *
	 * @param array $settings .
	 *
	 * @return array
	 */
	public function prepare_settings_for_display( array $settings ) {
		$modifier = new WooCommerceSettingsFieldsModifier();
		$settings = $modifier->append_beacon_search_data_to_fields( $settings );

		return apply_filters( 'flexible-shipping/settings/prepare-for-display', $settings );
	}
}