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_Admin_Options::html_select_operator( array $attributes = null, string $selected_value = null )
Creates a dropdown select that contains logical operators.
Contents
Parameters Parameters
- $attributes
-
(array) (Optional)
Default value: null
- $selected_value
-
(string) (Optional)
Default value: null
Return Return
(string)
Source Source
File: includes/admin/class-admin-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, '', '" ', PHP_QUERY_RFC3986 ) ) . '"'; } return sprintf( '<select%s>%s</select>', urldecode( $attribute_string ), $options ); }
Expand full source code Collapse full source code View on Github