WPF_USERGROUP::load_options()

Contents


Return Return

(array[])


Source Source

File: src/integrations/wpforo/actions/wpf-usergroup.php

	public function load_options() {
		$usergroups = WPF()->usergroup->get_usergroups();
		$group_options = array();
		foreach ( $usergroups as $key => $group ) {
			$group_options[ $group['groupid'] ] = $group['name'];
		}
		$option = array(
			'option_code' => 'FOROGROUP',
			'label'       => esc_attr__( 'User groups', 'uncanny-automator' ),
			'input_type'  => 'select',
			'required'    => true,
			'options'     => $group_options,
		);
		return Automator()->utilities->keep_order_of_options(
			array(
				'options' => array(
					$option,
				),
			)
		);
	}