Plugin Directory

Changeset 1605130


Ignore:
Timestamp:
02/28/2017 10:35:28 AM (9 years ago)
Author:
Cohhe
Message:

Renamed function because it was causing an error

Location:
directory-builder
Files:
2 edited
28 copied

Legend:

Unmodified
Added
Removed
  • directory-builder/tags/1.4.1/README.txt

    r1605116 r1605130  
    44Requires at least: 4.5.3
    55Tested up to: 4.7.2
    6 Stable tag: 1.4
     6Stable tag: 1.4.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2525
    2626== Changelog ==
     27
     28= 1.4.1 =
     29* Renamed function because it was not compatible with other plugin and was causing and error
    2730
    2831= 1.4 =
  • directory-builder/tags/1.4.1/directory-builder.php

    r1605116 r1605130  
    1717 * Plugin URI:        https://cohhe.com/
    1818 * Description:       Directory builder provides listing functionality for your theme.
    19  * Version:           1.4
     19 * Version:           1.4.1
    2020 * Author:            Cohhe
    2121 * Author URI:        https://cohhe.com/
     
    61606160add_action( 'wp_ajax_nopriv_db_get_current_package', 'db_get_current_package_func' );
    61616161
    6162 if ( !function_exists('db_save_billing_func') ) {
    6163     function db_save_billing_func() {
    6164         $field_data = ( isset($_POST['field_data']) ? json_decode(htmlspecialchars_decode(stripslashes($_POST['field_data'])), true) : '' );
    6165         $listing_id = ( isset($_POST['listing_id']) ? intval($_POST['listing_id']) : '' );
    6166         $card_data = ( isset($_POST['card_data']) ? json_decode(htmlspecialchars_decode(stripslashes($_POST['card_data'])), true) : '' );
    6167         $gateway = ( isset($_POST['gateway']) ? $_POST['gateway'] : '' );
    6168         $billing_info = get_post_meta( $listing_id, 'db_billing_info', true );
    6169 
    6170         if ( $billing_info == '' ) {
    6171             update_post_meta( $listing_id, 'db_billing_info', $field_data );
    6172         }
    6173 
    6174         if ( $listing_id ) {
    6175             if ( $gateway == 'authorizenet' ) {
    6176                 if ( function_exists('db_check_authorize_card') ) {
    6177                     db_check_authorize_card( $card_data );
    6178                 } else {
    6179                     echo '{"save_response": "failed", "message": "'.__('Couldn\'t find Authorize.Net', 'functionality-for-directory-theme').'"}';
    6180                 }
     6162
     6163function db_save_billing_function() {
     6164    $field_data = ( isset($_POST['field_data']) ? json_decode(htmlspecialchars_decode(stripslashes($_POST['field_data'])), true) : '' );
     6165    $listing_id = ( isset($_POST['listing_id']) ? intval($_POST['listing_id']) : '' );
     6166    $card_data = ( isset($_POST['card_data']) ? json_decode(htmlspecialchars_decode(stripslashes($_POST['card_data'])), true) : '' );
     6167    $gateway = ( isset($_POST['gateway']) ? $_POST['gateway'] : '' );
     6168    $billing_info = get_post_meta( $listing_id, 'db_billing_info', true );
     6169
     6170    if ( $billing_info == '' ) {
     6171        update_post_meta( $listing_id, 'db_billing_info', $field_data );
     6172    }
     6173
     6174    if ( $listing_id ) {
     6175        if ( $gateway == 'authorizenet' ) {
     6176            if ( function_exists('db_check_authorize_card') ) {
     6177                db_check_authorize_card( $card_data );
    61816178            } else {
    6182                 echo '{"save_response": "'.$listing_id.'"}';
     6179                echo '{"save_response": "failed", "message": "'.__('Couldn\'t find Authorize.Net', 'functionality-for-directory-theme').'"}';
    61836180            }
    61846181        } else {
    6185             echo '{"save_response": "failed", "message": "'.__('There was an issue while saving your billing information!', 'functionality-for-directory-theme').'"}';
    6186         }
    6187 
    6188         die(0);
    6189     }
    6190 }
    6191 add_action( 'wp_ajax_db_save_billing', 'db_save_billing_func' );
    6192 add_action( 'wp_ajax_nopriv_db_save_billing', 'db_save_billing_func' );
     6182            echo '{"save_response": "'.$listing_id.'"}';
     6183        }
     6184    } else {
     6185        echo '{"save_response": "failed", "message": "'.__('There was an issue while saving your billing information!', 'functionality-for-directory-theme').'"}';
     6186    }
     6187
     6188    die(0);
     6189}
     6190add_action( 'wp_ajax_db_save_billing', 'db_save_billing_function' );
     6191add_action( 'wp_ajax_nopriv_db_save_billing', 'db_save_billing_function' );
    61936192
    61946193function db_update_ipn_notes( $listing_id, $message ) {
  • directory-builder/trunk/README.txt

    r1605116 r1605130  
    44Requires at least: 4.5.3
    55Tested up to: 4.7.2
    6 Stable tag: 1.4
     6Stable tag: 1.4.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2525
    2626== Changelog ==
     27
     28= 1.4.1 =
     29* Renamed function because it was not compatible with other plugin and was causing and error
    2730
    2831= 1.4 =
  • directory-builder/trunk/directory-builder.php

    r1605116 r1605130  
    1717 * Plugin URI:        https://cohhe.com/
    1818 * Description:       Directory builder provides listing functionality for your theme.
    19  * Version:           1.4
     19 * Version:           1.4.1
    2020 * Author:            Cohhe
    2121 * Author URI:        https://cohhe.com/
     
    61606160add_action( 'wp_ajax_nopriv_db_get_current_package', 'db_get_current_package_func' );
    61616161
    6162 if ( !function_exists('db_save_billing_func') ) {
    6163     function db_save_billing_func() {
    6164         $field_data = ( isset($_POST['field_data']) ? json_decode(htmlspecialchars_decode(stripslashes($_POST['field_data'])), true) : '' );
    6165         $listing_id = ( isset($_POST['listing_id']) ? intval($_POST['listing_id']) : '' );
    6166         $card_data = ( isset($_POST['card_data']) ? json_decode(htmlspecialchars_decode(stripslashes($_POST['card_data'])), true) : '' );
    6167         $gateway = ( isset($_POST['gateway']) ? $_POST['gateway'] : '' );
    6168         $billing_info = get_post_meta( $listing_id, 'db_billing_info', true );
    6169 
    6170         if ( $billing_info == '' ) {
    6171             update_post_meta( $listing_id, 'db_billing_info', $field_data );
    6172         }
    6173 
    6174         if ( $listing_id ) {
    6175             if ( $gateway == 'authorizenet' ) {
    6176                 if ( function_exists('db_check_authorize_card') ) {
    6177                     db_check_authorize_card( $card_data );
    6178                 } else {
    6179                     echo '{"save_response": "failed", "message": "'.__('Couldn\'t find Authorize.Net', 'functionality-for-directory-theme').'"}';
    6180                 }
     6162
     6163function db_save_billing_function() {
     6164    $field_data = ( isset($_POST['field_data']) ? json_decode(htmlspecialchars_decode(stripslashes($_POST['field_data'])), true) : '' );
     6165    $listing_id = ( isset($_POST['listing_id']) ? intval($_POST['listing_id']) : '' );
     6166    $card_data = ( isset($_POST['card_data']) ? json_decode(htmlspecialchars_decode(stripslashes($_POST['card_data'])), true) : '' );
     6167    $gateway = ( isset($_POST['gateway']) ? $_POST['gateway'] : '' );
     6168    $billing_info = get_post_meta( $listing_id, 'db_billing_info', true );
     6169
     6170    if ( $billing_info == '' ) {
     6171        update_post_meta( $listing_id, 'db_billing_info', $field_data );
     6172    }
     6173
     6174    if ( $listing_id ) {
     6175        if ( $gateway == 'authorizenet' ) {
     6176            if ( function_exists('db_check_authorize_card') ) {
     6177                db_check_authorize_card( $card_data );
    61816178            } else {
    6182                 echo '{"save_response": "'.$listing_id.'"}';
     6179                echo '{"save_response": "failed", "message": "'.__('Couldn\'t find Authorize.Net', 'functionality-for-directory-theme').'"}';
    61836180            }
    61846181        } else {
    6185             echo '{"save_response": "failed", "message": "'.__('There was an issue while saving your billing information!', 'functionality-for-directory-theme').'"}';
    6186         }
    6187 
    6188         die(0);
    6189     }
    6190 }
    6191 add_action( 'wp_ajax_db_save_billing', 'db_save_billing_func' );
    6192 add_action( 'wp_ajax_nopriv_db_save_billing', 'db_save_billing_func' );
     6182            echo '{"save_response": "'.$listing_id.'"}';
     6183        }
     6184    } else {
     6185        echo '{"save_response": "failed", "message": "'.__('There was an issue while saving your billing information!', 'functionality-for-directory-theme').'"}';
     6186    }
     6187
     6188    die(0);
     6189}
     6190add_action( 'wp_ajax_db_save_billing', 'db_save_billing_function' );
     6191add_action( 'wp_ajax_nopriv_db_save_billing', 'db_save_billing_function' );
    61936192
    61946193function db_update_ipn_notes( $listing_id, $message ) {
Note: See TracChangeset for help on using the changeset viewer.