WC_Settings_Page::get_custom_type_field
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
Returns
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() WC Settings Page::get custom type field code WC 10.8.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'] : wp_unique_prefixed_id( 'settings_custom_view' );
$setting['type'] = 'custom';
return $setting;
}