Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825
Warning: foreach() argument must be of type array|object, string given in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 830
Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825
Automator_Helpers_Recipe_Field::select( $args = array() )
Contents
Warning: foreach() argument must be of type array|object, string given in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 830
Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825
Parameters Parameters
- $args
(Optional)
Default value: array()
Return Return
(mixed|void)
Source Source
File: src/core/lib/helpers/class-automator-recipe-helpers-field.php
public function select( array $args = array() ) { $defaults = array( 'option_code' => 'SELECT', 'label' => esc_attr__( 'Option', 'uncanny-automator' ), 'input_type' => 'select', 'supports_tokens' => apply_filters( 'automator_option_select_field', false ), 'required' => true, 'default_value' => null, 'options' => array(), 'custom_value_description' => '', 'supports_custom_value' => null, 'relevant_tokens' => null, 'is_ajax' => false, 'chained_to' => null, 'endpoint' => null, ); $args = wp_parse_args( $args, $defaults ); $option_code = $args['option_code']; $input_type = $args['input_type']; $label = $args['label']; $required = $args['required']; $default = $args['default_value']; $options = $args['options']; $custom_value_description = $args['custom_value_description']; $supports_custom_value = $args['supports_custom_value']; $supports_tokens = $args['supports_tokens']; $relevant_tokens = $args['relevant_tokens']; $option = array( 'option_code' => $option_code, 'label' => $label, 'input_type' => $input_type, 'supports_tokens' => $supports_tokens, 'required' => $required, 'default_value' => $default, 'options' => $options, 'custom_value_description' => $custom_value_description, 'supports_custom_value' => $supports_custom_value, 'relevant_tokens' => $relevant_tokens, ); // TODO:: add keys optionally // 'is_ajax' => false, // 'chained_to' => null, // 'endpoint' => null, return apply_filters( 'automator_option_select_field', $option ); }
Expand full source code Collapse full source code View on Github