Title: Notices if WP_DEBUG is enabled
Last modified: August 22, 2016

---

# Notices if WP_DEBUG is enabled

 *  Resolved [Papik81](https://wordpress.org/support/users/papik81/)
 * (@papik81)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/notices-if-wp_debug-is-enabled/)
 * It throws notices if the variable is not found: from 139 to 144: Id recomend 
   update this code:
 *     ```
       public function woocommerce_formatted_address_replacements( $replace, $args) {
       		extract( $args );
       		return $replace += array(
       			'{company_number}' => $company_number == '' ? '' : __('Company number: ', 'custom-account-fields') . $company_number,
       			'{vat_number}' => $vat_number == '' ? '' : __('VAT number: ', 'custom-account-fields') . $vat_number,
       			'{vat_number_2}' => $vat_number_2 == '' ? '' : __('VAT number 2: ', 'custom-account-fields') . $vat_number_2,
       			'{company_number_upper}' => strtoupper($company_number == '' ? '' : __('Company number: ', 'custom-account-fields') . $company_number),
       			'{vat_number_upper}' => strtoupper($vat_number == '' ? '' : __('VAT number: ', 'custom-account-fields') . $vat_number),
       			'{vat_number_upper_2}' => strtoupper($vat_number_2 == '' ? '' : __('VAT number 2: ', 'custom-account-fields') . $vat_number_2),
       		);
       	}
       ```
   
 * to
 *     ```
       public function woocommerce_formatted_address_replacements( $replace, $args) {
       		 return $replace += array(
       			'{company_number}' => isset($args['company_number']) ?  __('Company number: ', 'custom-account-fields') .$args['company_number'] : '',
            	    '{vat_number}' => isset($args['vat_number']) ?  __('VAT number: ', 'custom-account-fields') . $args['vat_number'] : '',
       			'{vat_number_2}' => isset($args['vat_number_2']) ?  __('VAT number 2: ', 'custom-account-fields') . $args['vat_number_2'] :'',
       			'{company_number_upper}' => strtoupper(isset($args['company_number']) ?__('Company number: ', 'custom-account-fields') . $args['company_number'] : '' ),
       			'{vat_number_upper}' => strtoupper(isset($args['vat_number']) ? __('VAT number: ', 'custom-account-fields') . $args['vat_number'] : ''),
       			'{vat_number_upper_2}' => strtoupper(isset($args['vat_number_2']) ? __('VAT number 2: ', 'custom-account-fields') . $args['vat_number_2'] : '') ,
       			);
       	}
       ```
   
 * I also recomend to remove the extract function cause here it is not the best 
   idea.
 * [https://wordpress.org/plugins/custom-account-fields/](https://wordpress.org/plugins/custom-account-fields/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [Papik81](https://wordpress.org/support/users/papik81/)
 * (@papik81)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/notices-if-wp_debug-is-enabled/#post-5746183)
 * CZ: Pokud je zapnutý debug a není zcela vyplněný profil fakturační adresy, vypisuje
   to hlášky :variable is not found: from 139 to 144: Id doporučil bych aktualizovat
   kód:
 *     ```
       public function woocommerce_formatted_address_replacements( $replace, $args) {
       		extract( $args );
       		return $replace += array(
       			'{company_number}' => $company_number == '' ? '' : __('Company number: ', 'custom-account-fields') . $company_number,
       			'{vat_number}' => $vat_number == '' ? '' : __('VAT number: ', 'custom-account-fields') . $vat_number,
       			'{vat_number_2}' => $vat_number_2 == '' ? '' : __('VAT number 2: ', 'custom-account-fields') . $vat_number_2,
       			'{company_number_upper}' => strtoupper($company_number == '' ? '' : __('Company number: ', 'custom-account-fields') . $company_number),
       			'{vat_number_upper}' => strtoupper($vat_number == '' ? '' : __('VAT number: ', 'custom-account-fields') . $vat_number),
       			'{vat_number_upper_2}' => strtoupper($vat_number_2 == '' ? '' : __('VAT number 2: ', 'custom-account-fields') . $vat_number_2),
       		);
       	}
       ```
   
 * na
 *     ```
       public function woocommerce_formatted_address_replacements( $replace, $args) {
       		 return $replace += array(
       			'{company_number}' => isset($args['company_number']) ?  __('Company number: ', 'custom-account-fields') .$args['company_number'] : '',
            	    '{vat_number}' => isset($args['vat_number']) ?  __('VAT number: ', 'custom-account-fields') . $args['vat_number'] : '',
       			'{vat_number_2}' => isset($args['vat_number_2']) ?  __('VAT number 2: ', 'custom-account-fields') . $args['vat_number_2'] :'',
       			'{company_number_upper}' => strtoupper(isset($args['company_number']) ?__('Company number: ', 'custom-account-fields') . $args['company_number'] : '' ),
       			'{vat_number_upper}' => strtoupper(isset($args['vat_number']) ? __('VAT number: ', 'custom-account-fields') . $args['vat_number'] : ''),
       			'{vat_number_upper_2}' => strtoupper(isset($args['vat_number_2']) ? __('VAT number 2: ', 'custom-account-fields') . $args['vat_number_2'] : '') ,
       			);
       	}
       ```
   
 * Také doporučuji nepoužívat funkci extract a přistupovat přímo do pole.
 *  Plugin Author [tomas.slavik](https://wordpress.org/support/users/tomasslavik/)
 * (@tomasslavik)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/notices-if-wp_debug-is-enabled/#post-5746546)
 * Ok. Thank you for recommendation. Updated.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Notices if WP_DEBUG is enabled’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-account-fields.svg)
 * [Custom account fields](https://wordpress.org/plugins/custom-account-fields/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-account-fields/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-account-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-account-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-account-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-account-fields/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [tomas.slavik](https://wordpress.org/support/users/tomasslavik/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/notices-if-wp_debug-is-enabled/#post-5746546)
 * Status: resolved