changed acf field access from _name to _key
This commit is contained in:
@@ -14,10 +14,10 @@ if (!defined('ABSPATH')) {
|
||||
* return value of an acf field, no matter if the field is set up to return label or value
|
||||
*
|
||||
*/
|
||||
function get_acf_value_CIPF($field_name, $acf_id) {
|
||||
$field_object = get_field_object($field_name, $acf_id);
|
||||
function get_acf_value_CIPF($acf_field, $acf_id) {
|
||||
$field_object = get_field_object($acf_field['_key'], $acf_id);
|
||||
$return_format = $field_object['return_format'];
|
||||
$field = get_field($field_name, $acf_id);
|
||||
$field = get_field($acf_field['_key'], $acf_id);
|
||||
|
||||
$value = null;
|
||||
if ($return_format === 'array') {
|
||||
@@ -70,8 +70,8 @@ function check_can_pay_CIPF() {
|
||||
* in case it was changed from admin pannel
|
||||
*
|
||||
*/
|
||||
$tarif = get_acf_value_CIPF($acf_card_price_choice['_name'], $acf_id);
|
||||
$livraison = get_acf_value_CIPF($acf_card_price_delivery['_name'], $acf_id);
|
||||
$tarif = get_acf_value_CIPF($acf_card_price_choice, $acf_id);
|
||||
$livraison = get_acf_value_CIPF($acf_card_price_delivery, $acf_id);
|
||||
if ($tarif !== null && $livraison !== null) {
|
||||
$price = $tarif + $livraison;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user