PodsField_Pick::options PHP Method

options() public method

Add options and set defaults to
Since: 2.0
public options ( ) : array
return array
    public function options()
    {
        $options = array(self::$type . '_format_type' => array('label' => __('Selection Type', 'pods'), 'help' => __('help', 'pods'), 'default' => 'single', 'type' => 'pick', 'data' => array('single' => __('Single Select', 'pods'), 'multi' => __('Multiple Select', 'pods')), 'dependency' => true), self::$type . '_format_single' => array('label' => __('Format', 'pods'), 'help' => __('help', 'pods'), 'depends-on' => array(self::$type . '_format_type' => 'single'), 'default' => 'dropdown', 'type' => 'pick', 'data' => apply_filters('pods_form_ui_field_pick_format_single_options', array('dropdown' => __('Drop Down', 'pods'), 'radio' => __('Radio Buttons', 'pods'), 'autocomplete' => __('Autocomplete', 'pods')) + (pods_developer() && 1 == 0 ? array('flexible' => __('Flexible', 'pods')) : array())), 'dependency' => true), self::$type . '_format_multi' => array('label' => __('Format', 'pods'), 'help' => __('help', 'pods'), 'depends-on' => array(self::$type . '_format_type' => 'multi'), 'default' => 'checkbox', 'type' => 'pick', 'data' => apply_filters('pods_form_ui_field_pick_format_multi_options', array('checkbox' => __('Checkboxes', 'pods'), 'multiselect' => __('Multi Select', 'pods'), 'autocomplete' => __('Autocomplete', 'pods')) + (pods_developer() && 1 == 0 ? array('flexible' => __('Flexible', 'pods')) : array())), 'dependency' => true), self::$type . '_taggable' => array('label' => __('Taggable', 'pods'), 'help' => __('Allow new values to be inserted when using an Autocomplete field', 'pods'), 'excludes-on' => array(self::$type . '_format_single' => array('dropdown', 'radio'), self::$type . '_format_multi' => array('checkbox', 'multiselect'), self::$type . '_object' => array_merge(array('site', 'network'), self::simple_objects())), 'type' => 'boolean', 'default' => 0), self::$type . '_select_text' => array('label' => __('Default Select Text', 'pods'), 'help' => __('This is the text use for the default "no selection" dropdown item, if empty, it will default to "-- Select One --"', 'pods'), 'depends-on' => array(self::$type . '_format_type' => 'single', self::$type . '_format_single' => 'dropdown'), 'default' => '', 'type' => 'text'), self::$type . '_limit' => array('label' => __('Selection Limit', 'pods'), 'help' => __('help', 'pods'), 'depends-on' => array(self::$type . '_format_type' => 'multi'), 'default' => 0, 'type' => 'number'), self::$type . '_allow_html' => array('label' => __('Allow HTML', 'pods'), 'type' => 'boolean', 'default' => 0), self::$type . '_table_id' => array('label' => __('Table ID Column', 'pods'), 'help' => __('You must provide the ID column name for the table, this will be used to keep track of the relationship', 'pods'), 'depends-on' => array(self::$type . '_object' => 'table'), 'required' => 1, 'default' => '', 'type' => 'text'), self::$type . '_table_index' => array('label' => __('Table Index Column', 'pods'), 'help' => __('You must provide the index column name for the table, this may optionally also be the ID column name', 'pods'), 'depends-on' => array(self::$type . '_object' => 'table'), 'required' => 1, 'default' => '', 'type' => 'text'), self::$type . '_display' => array('label' => __('Display Field in Selection List', 'pods'), 'help' => __('Provide the name of a field on the related object to reference, example: {@post_title}', 'pods'), 'excludes-on' => array(self::$type . '_object' => array_merge(array('site', 'network'), self::simple_objects())), 'default' => '', 'type' => 'text'), self::$type . '_user_role' => array('label' => __('Limit list to Role(s)', 'pods'), 'help' => __('help', 'pods'), 'depends-on' => array(self::$type . '_object' => 'user'), 'default' => '', 'type' => 'pick', 'pick_object' => 'role', 'pick_format_type' => 'multi'), self::$type . '_where' => array('label' => __('Customized <em>WHERE</em>', 'pods'), 'help' => __('help', 'pods'), 'excludes-on' => array(self::$type . '_object' => array_merge(array('site', 'network'), self::simple_objects())), 'default' => '', 'type' => 'text'), self::$type . '_orderby' => array('label' => __('Customized <em>ORDER BY</em>', 'pods'), 'help' => __('help', 'pods'), 'excludes-on' => array(self::$type . '_object' => array_merge(array('site', 'network'), self::simple_objects())), 'default' => '', 'type' => 'text'), self::$type . '_groupby' => array('label' => __('Customized <em>GROUP BY</em>', 'pods'), 'help' => __('help', 'pods'), 'excludes-on' => array(self::$type . '_object' => array_merge(array('site', 'network'), self::simple_objects())), 'default' => '', 'type' => 'text'));
        $post_type_pick_objects = array();
        foreach (get_post_types('', 'names') as $post_type) {
            $post_type_pick_objects[] = 'post-type_' . $post_type;
        }
        $options[self::$type . '_post_status'] = array('name' => 'post_status', 'label' => __('Post Status', 'pods'), 'help' => __('help', 'pods'), 'type' => 'pick', 'pick_object' => 'post-status', 'pick_format_type' => 'multi', 'default' => 'publish', 'depends-on' => array(self::$type . '_object' => $post_type_pick_objects));
        /*if ( !is_multisite() )
          unset( $options[ self::$type . '_user_site' ] );*/
        return $options;
    }