WC_Settings_Page::get_custom_type_field()publicWC 1.0

Get the custom type field by calling the action and returning the setting with the content, id, and type.

Method of the class: WC_Settings_Page{}

Hooks from the method

Return

Array. The setting with the content, id, and type.

Usage

$WC_Settings_Page = new WC_Settings_Page();
$WC_Settings_Page->get_custom_type_field( $action, $setting );
$action(string) (required)
The action to call.
$setting(array) (required)
The setting to pass to the action.

WC_Settings_Page::get_custom_type_field() code WC 9.7.1

public function get_custom_type_field( $action, $setting ) {
	ob_start();
	/**
	 * Output the custom type field by calling the action.
	 *
	 * @since 3.3.0
	 */
	do_action( $action, $setting );
	$html = ob_get_contents();
	ob_end_clean();
	$setting['content'] = trim( $html );
	$setting['id']      = isset( $setting['id'] ) ? $setting['id'] : $setting['type'];
	$setting['type']    = 'custom';

	return $setting;
}