Plugin Directory

Changeset 2057112


Ignore:
Timestamp:
03/25/2019 07:36:52 PM (7 years ago)
Author:
foreupsoftware
Message:

changed location of account number check

Location:
foreup-forms/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • foreup-forms/trunk/README.txt

    r2056366 r2057112  
    55Requires at least: 5.1
    66Tested up to: 5.1
    7 Stable tag: 1.1.2
     7Stable tag: 1.1.3
    88Requires PHP: 5.2.4
    99License: GPLv2 or later
  • foreup-forms/trunk/package.json

    r2056366 r2057112  
    11{
    22    "name": "foreUP Forms",
    3     "version": "1.1.2",
     3    "version": "1.1.3",
    44    "description": "Forms that integrate with foreUP Golf Software",
    55    "author": "Nathan Johnson <nathan@foreup.com>",
  • foreup-forms/trunk/plugin.php

    r2056458 r2057112  
    44Plugin URI: https://foreup.com/
    55Description: Forms that integrate with foreUP Golf Software
    6 Version: 1.1.2
     6Version: 1.1.3
    77Author: foreUP Software
    88Author URI: https://freakingjohnson.github.io/portfolio/
     
    397397     * @return void
    398398     */
    399     public function check_account_num(){
     399    public function check_account_num()
     400    {
    400401        $courseid = get_option('formup_courseid');
    401402        $account_num = get_option('formup_account_counter');
    402         if(get_option('formup_account_prefix') and get_option('formup_account_counter')){
     403        if (get_option('formup_account_prefix') and get_option('formup_account_counter')) {
    403404            $account_num = "ON" . $account_num;
    404405        };
     
    418419        $res = wp_remote_retrieve_body($response);
    419420        $res1 = json_decode($res);
    420         $res2 = $res1 -> data;
    421         if(count($res2)){
    422             update_option('formup_account_counter', get_option('formup_account_counter')+1);
     421        $res2 = $res1->data;
     422        if (count($res2)) {
     423            update_option('formup_account_counter', get_option('formup_account_counter') + 1);
    423424            $this->check_account_num();
    424425        };
     
    429430        $formup_password = get_option('formup_password');
    430431        $this->gen_token($formup_username, $formup_password);
    431         $this->check_account_num();
     432        // $this->check_account_num();
    432433        $this->includes();
    433434        $this->init_hooks();
     
    878879    public function check_email(WP_REST_Request $request)
    879880    {
     881        $this->check_account_num();
    880882        $courseid = get_option('formup_courseid');
    881883        $email = sanitize_text_field(trim($request['email']));
     
    907909        $account_prefix = "ON";
    908910
    909         if(!get_option('formup_account_counter')){
     911        if (!get_option('formup_account_counter')) {
    910912            $account_number = null;
    911         } elseif(get_option('formup_account_prefix') and get_option('formup_account_counter')){
     913        } elseif (get_option('formup_account_prefix') and get_option('formup_account_counter')) {
    912914            $account_number = $account_prefix . $account_num;
    913915        } else {
     
    932934        date_default_timezone_set('UTC');
    933935
    934         if($account_number){
     936        if ($account_number) {
    935937            $body = "{
    936938                \"data\": {
     
    966968                      }
    967969                  }";
    968         }else{
     970        } else {
    969971            $body = "{
    970972                \"data\": {
     
    10131015        if ($body) {
    10141016            $this->confirmation_email($email, $first, $last);
    1015             if($account_number){
    1016                 update_option('formup_account_counter', get_option('formup_account_counter')+1);
     1017            if ($account_number) {
     1018                update_option('formup_account_counter', get_option('formup_account_counter') + 1);
    10171019            }
    10181020        }
Note: See TracChangeset for help on using the changeset viewer.