WC_Settings_Payment_Gateways_React::render_react_section()
Render the React section.
Method of the class: WC_Settings_Payment_Gateways_React{}
No Hooks.
Return
null
. Nothing (null).
Usage
// private - for code of main (parent) class only $result = $this->render_react_section( $section );
- $section(string) (required)
- The section to render.
WC_Settings_Payment_Gateways_React::render_react_section() WC Settings Payment Gateways React::render react section code WC 9.5.1
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>'; }