| @@ -8,16 +8,8 @@ | ||
| 8 | 8 | |
| 9 | 9 | public static function init(): void { |
| 10 | 10 | self::send(); |
| 11 | 11 | |
| 12 | - $options = get_option( '_wp_coder_tools', [] ); | |
| 13 | - | |
| 14 | - $tools = [ | |
| 15 | - 'integrations' => __( 'Integrations', 'wpcoderpro' ), | |
| 16 | - 'content' => __( 'Content & Templates', 'wpcoderpro' ), | |
| 17 | - 'developer' => __( 'Developer', 'wpcoderpro' ), | |
| 18 | - ]; | |
| 19 | - | |
| 20 | 12 | ?> |
| 21 | 13 | |
| 22 | 14 | <div class="wowp-settings wowp-tools"> |
| 23 | 15 | <form method="post"> |
| @@ -27,43 +19,19 @@ | ||
| 27 | 19 | <p class="wowp-snippets__header-description">Manage useful features and external service |
| 28 | 20 | integrations to enhance your site.</p> |
| 29 | 21 | </div> |
| 30 | 22 | |
| 31 | - <div class="wowp-snippets__tabs" id="wowp-snippets-tabs"> | |
| 32 | - <?php | |
| 33 | - foreach ( $tools as $key => $value ) { | |
| 34 | - $tab = ! empty( $options['tool_tab'] ) ? $options['tool_tab'] : 'integrations'; | |
| 35 | - echo '<input type="radio" class="wowp-snippets__tabs-radio" name="wp_coder_tool[tool_tab]" value="' . esc_attr( $key ) . '" id="wowp-tab-' . esc_attr( $key ) . '" ' . checked( $tab, | |
| 36 | - $key, false ) . '>'; | |
| 37 | - } | |
| 38 | - echo '<div class="wowp-snippets__tabs-labels">'; | |
| 39 | - foreach ( $tools as $key => $value ) { | |
| 40 | - echo '<label class="wowp-snippets__tabs-tab" for="wowp-tab-' . esc_attr( $key ) . '"><span class="icon icon-' . esc_attr( $key ) . '"></span>' . esc_html( $value ) . '</label>'; | |
| 41 | - } | |
| 42 | - echo '</div>'; | |
| 43 | - foreach ( $tools as $key => $value ) { | |
| 44 | - echo '<div class="wowp-snippets__tabs-content" data-content="wowp-tab-' . esc_attr( $key ) . '">'; | |
| 45 | - require_once plugin_dir_path( __FILE__ ) . 'pages/' . esc_attr( $key ) . '.php'; | |
| 46 | - echo '<input type="submit" name="submit" class="wowp-button button button-dark button-hero" value="' . esc_attr__( 'Save', | |
| 47 | - 'wpcoderpro' ) . '">'; | |
| 48 | - echo '</div>'; | |
| 49 | - } | |
| 50 | 23 | |
| 51 | - ?> | |
| 52 | - </div> | |
| 24 | + <?php require_once plugin_dir_path( __FILE__ ) . '/page.php'; ?> | |
| 53 | 25 | |
| 54 | - <?php | |
| 55 | - // require_once plugin_dir_path( __FILE__ ) . '/page.php'; ?> | |
| 26 | + <?php submit_button( __( 'Save', 'wp-coder' ), 'wowp-button button button-dark button-hero', 'submit', false ); ?> | |
| 56 | 27 | |
| 57 | - <?php | |
| 58 | - // submit_button( __( 'Save', 'wpcoderpro' ), 'wowp-button button button-dark button-hero', 'submit', false ); ?> | |
| 28 | + <?php wp_nonce_field( WPCoder::PREFIX . '_tools_action', WPCoder::PREFIX . '_save_tools' ); ?> | |
| 59 | 29 | |
| 60 | - <?php | |
| 61 | - wp_nonce_field( WPCoder::PREFIX . '_tools_action', WPCoder::PREFIX . '_save_tools' ); ?> | |
| 62 | - | |
| 63 | 30 | </form> |
| 64 | 31 | </div> |
| 65 | 32 | <?php |
| 33 | + | |
| 66 | 34 | } |
| 67 | 35 | |
| 68 | 36 | private static function option( $name = '', $def = '' ) { |
| 69 | 37 | $options = get_option( '_wp_coder_tools', [] ); |