WC_Settings_Payment_Gateways_React::render_react_section()
Render the React section.
Метод класса: WC_Settings_Payment_Gateways_React{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
// private - только в коде основоного (родительского) класса $result = $this->render_react_section( $section );
- $section(строка) (обязательный)
- The section to render.
Код WC_Settings_Payment_Gateways_React::render_react_section() WC Settings Payment Gateways React::render react section WC 9.4.2
private function render_react_section( $section ) { global $hide_save_button; $hide_save_button = true; echo '<div id="experimental_wc_settings_payments_' . esc_attr( $section ) . '"></div>'; // Output the gateways data to the page so the React app can use it. $controller = new WC_REST_Payment_Gateways_Controller(); $response = $controller->get_items( new WP_REST_Request( 'GET', '/wc/v3/payment_gateways' ) ); echo '<script type="application/json" id="experimental_wc_settings_payments_gateways">' . wp_json_encode( $response->data ) . '</script>'; }