PodsField_Pick::data_roles PHP Method

data_roles() public method

Data callback for User Roles
Since: 2.3
public data_roles ( string $name = null, string | array $value = null, array $options = null, array $pod = null, integer $id = null ) : array
$name string The name of the field
$value string | array The value of the field
$options array Field options
$pod array Pod data
$id integer Item ID
return array
    public function data_roles($name = null, $value = null, $options = null, $pod = null, $id = null)
    {
        $data = array();
        global $wp_roles;
        foreach ($wp_roles->role_objects as $key => $role) {
            $data[$key] = $wp_roles->role_names[$key];
        }
        return apply_filters('pods_form_ui_field_pick_' . __FUNCTION__, $data, $name, $value, $options, $pod, $id);
    }