get_options(); $updated = []; foreach ( $keys as $key => $default_value ) { if ( isset( $_POST[ $key ] ) ) { $value = sanitize_text_field( wp_unslash( $_POST[ $key ] ) ); $updated[ $key ] = $value; $option_key = 'ajaxpress_' . $key; update_option( $option_key, $value ); } } wp_send_json_success( $updated ); } /** * Plugin action links * * @param array $links Plugin action links. * @return array */ public function plugin_action_links( $links ) { // Unshihft link. array_unshift( $links, sprintf( '%s', admin_url( 'options-general.php?page=ajaxpress' ), __( 'Settings', 'ajaxpress' ) ) ); return $links; } } Settings::init();