PeepSo_Helpers::get_profile_fields( $label = null,  $option_code = 'PPPROFILEFIELDS',  $args = array(),  $bynames = false )


Parameters Parameters

(Required) profile fields


Source Source

File: src/integrations/peepso/helpers/peepso-helpers.php

	public function get_profile_fields( $label = null, $option_code = 'PPPROFILEFIELDS', $args = array(), $bynames = false ) {

		if ( ! $this->load_options ) {
			return Automator()->helpers->recipe->build_default_options_array( $label, $option_code );
		}

		if ( ! $label ) {
			$label = esc_attr__( 'Profile fields', 'uncanny-automator' );
		}

		$args = wp_parse_args(
			$args,
			array(
				'uo_include_any' => ( true === $args['uo_include_any'] ) ? true : false,
				'uo_any_label'   => esc_attr__( 'Any field', 'uncanny-automator' ),
			)
		);

		$options = array();
		$options = $this->get_user_fields( 0, $args['uo_include_any'], $args );

		$option = array(
			'option_code'     => $option_code,
			'label'           => $label,
			'input_type'      => 'select',
			'required'        => true,
			'options'         => $options,
			'relevant_tokens' => array(),
		);

		return apply_filters( 'uap_option_peepso_users_profile_fields', $option );
	}