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.
Метод класса: WC_Settings_Page{}
Хуки из метода
Возвращает
Массив. The setting with the content, id, and type.
Использование
$WC_Settings_Page = new WC_Settings_Page(); $WC_Settings_Page->get_custom_type_field( $action, $setting );
- $action(строка) (обязательный)
- The action to call.
- $setting(массив) (обязательный)
- The setting to pass to the action.
Код WC_Settings_Page::get_custom_type_field() WC Settings Page::get custom type field WC 10.4.3
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;
}