Add backtrace to deprecated message
This commit is contained in:
parent
307a42b37e
commit
3e9f74d038
|
@ -145,7 +145,7 @@ class WC_Order_Refund extends WC_Abstract_Order {
|
|||
* @return mixed
|
||||
*/
|
||||
public function __get( $key ) {
|
||||
wc_doing_it_wrong( $key, 'Refund properties should not be accessed directly.', '3.0' );
|
||||
wc_doing_it_wrong( $key, 'Refund properties should not be accessed directly. Called by: ' . wp_debug_backtrace_summary( __CLASS__ ), '3.0' );
|
||||
/**
|
||||
* Maps legacy vars to new getters.
|
||||
*/
|
||||
|
|
|
@ -404,7 +404,7 @@ abstract class WC_Abstract_Legacy_Order extends WC_Data {
|
|||
* @return mixed
|
||||
*/
|
||||
public function __get( $key ) {
|
||||
wc_doing_it_wrong( $key, 'Order properties should not be accessed directly.', '3.0' );
|
||||
wc_doing_it_wrong( $key, 'Order properties should not be accessed directly. Called by: ' . wp_debug_backtrace_summary( __CLASS__ ), '3.0' );
|
||||
|
||||
if ( 'completed_date' === $key ) {
|
||||
return $this->get_date_completed() ? gmdate( 'Y-m-d H:i:s', $this->get_date_completed()->getOffsetTimestamp() ) : '';
|
||||
|
|
|
@ -69,7 +69,7 @@ abstract class WC_Abstract_Legacy_Product extends WC_Data {
|
|||
return $this->post_type;
|
||||
}
|
||||
|
||||
wc_doing_it_wrong( $key, __( 'Product properties should not be accessed directly.', 'woocommerce' ), '3.0' );
|
||||
wc_doing_it_wrong( $key, __( 'Product properties should not be accessed directly. Called by: ' . wp_debug_backtrace_summary( __CLASS__ ), 'woocommerce' ), '3.0' );
|
||||
|
||||
switch ( $key ) {
|
||||
case 'id' :
|
||||
|
|
|
@ -58,7 +58,7 @@ abstract class WC_Legacy_Coupon extends WC_Data {
|
|||
* @return mixed
|
||||
*/
|
||||
public function __get( $key ) {
|
||||
wc_doing_it_wrong( $key, 'Coupon properties should not be accessed directly.', '3.0' );
|
||||
wc_doing_it_wrong( $key, 'Coupon properties should not be accessed directly. Called by: ' . wp_debug_backtrace_summary( __CLASS__ ), '3.0' );
|
||||
|
||||
switch ( $key ) {
|
||||
case 'id' :
|
||||
|
|
|
@ -48,7 +48,7 @@ abstract class WC_Legacy_Customer extends WC_Data {
|
|||
* @return string
|
||||
*/
|
||||
public function __get( $key ) {
|
||||
wc_doing_it_wrong( $key, 'Customer properties should not be accessed directly.', '3.0' );
|
||||
wc_doing_it_wrong( $key, 'Customer properties should not be accessed directly. Called by: ' . wp_debug_backtrace_summary( __CLASS__ ), '3.0' );
|
||||
$key = $this->filter_legacy_key( $key );
|
||||
if ( in_array( $key, array( 'country', 'state', 'postcode', 'city', 'address_1', 'address', 'address_2' ) ) ) {
|
||||
$key = 'billing_' . $key;
|
||||
|
|
Loading…
Reference in New Issue