WC_Settings_Page::get_custom_view()
Get the custom view given the current tab and section.
Метод класса: WC_Settings_Page{}
Хуки из метода
Возвращает
Строку
. The custom view. HTML output.
Использование
$WC_Settings_Page = new WC_Settings_Page(); $WC_Settings_Page->get_custom_view( $section_id );
- $section_id(строка) (обязательный)
- The section id.
Код WC_Settings_Page::get_custom_view() WC Settings Page::get custom view WC 9.7.1
public function get_custom_view( $section_id ) { global $current_section; // Make sure the current section is set to the sectionid here. Reset it at the end of the function. $saved_current_section = $current_section; // set global current_section to the section_id. $current_section = $section_id; ob_start(); /** * Output the custom view given the current tab and section by calling the action. * * @since 2.1.0 */ do_action( 'woocommerce_settings_' . $this->id ); $html = ob_get_contents(); ob_end_clean(); // Reset the global variable. $current_section = $saved_current_section; return trim( $html ); }