Inventory_Presser_Options::sanitize_options( array $input )

sanitize_options


Description Description

Santitizes the user input into the options inputs before they are saved.


Top ↑

Parameters Parameters

$input

(array) (Required)


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/class-dealership-options.php

		foreach( INVP::keys( false ) as $key )
		{
			$meta_key = apply_filters( 'invp_prefix_meta_key', $key );

			//Skip hidden post meta keys
			if( '_' == $meta_key[0] )
			{
				continue;
			}

			$options .= sprintf(
				'<option value="%s"%s>%s</option>',
				$key,
				selected( $selected_value, $key, false ),
				str_replace( '_', ' ', ucfirst( $key ) )
			);
		}

		$attribute_string = '';
		if( ! empty( $attributes ) )
		{
			$attribute_string = ' ' . str_replace( "=", '="', http_build_query( $attributes, null, '" ', PHP_QUERY_RFC3986 ) ) . '"';
		}

		return sprintf(
			'<select%s>%s</select>',
			urldecode( $attribute_string ),
			$options
		);
	}
	
	/**
	 * options_page_content
	 * 
	 * Outputs the settings page HTML content
	 *
	 * @return void
	 */
	public function options_page_content()
	{
		wp_enqueue_script( 'invp_page_settings' );

		$this->option = INVP::settings();

		?><div class="wrap">
			<h2><?php _e( 'Inventory Presser Settings', 'inventory-presser' ); ?></h2>
			<?php settings_errors();

			?><form method="post" action="options.php">
				<?php
					settings_fields( 'dealership_options_option_group' );
					do_settings_sections( 'dealership-options-admin' );
					submit_button();

			?></form>
		</div><?php
	}
	
	/**
	 * sanitize_options
	 * 
	 * Santitizes the user input into the options inputs before they are saved.
	 *
	 * @param  array $input
	 * @return array
	 */
	public function sanitize_options( $input )
	{
		$sanitary_values = array();

		$boolean_settings = array(
			'additional_listings_page',
			'include_sold_vehicles',
			'show_all_taxonomies',
			'skip_trash',
			'use_carfax',
			'use_carfax_provided_buttons',
		);