Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

Inventory_Presser_Options::html_select_operator( array $attributes = null, string $selected_value = null )

html_select_operator


Description Description

Creates a dropdown select that contains logical operators.


Top ↑

Parameters Parameters

$attributes

(array) (Optional)

Default value: null

$selected_value

(string) (Optional)

Default value: null


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/class-dealership-options.php

	private function html_select_operator( $attributes = null, $selected_value = null )
	{
		$keys = array(
			'exists',
			'does not exist',
			'greater than',
			'less than',
			'equal to',
			'not equal to',
		);

		$options = '';
		foreach( $keys as $key )
		{
			$slug = str_replace( ' ', '_', $key );
			$options .= sprintf(
				'<option value="%s"%s>%s</option>',
				$slug,
				selected( $selected_value, $slug, false ),
				$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
		);
	}