| 1 |
<?php |
| 2 |
/** |
| 3 |
* Responsible for helping with debugging. |
| 4 |
* |
| 5 |
* @package Charitable/Classes/Charitable_Debugging |
| 6 |
* @author David Bisset |
| 7 |
* @copyright Copyright (c) 2023, WP Charitable LLC |
| 8 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 9 |
* @since 1.6.42 |
| 10 |
* @version 1.6.42 |
| 11 |
*/ |
| 12 |
|
| 13 |
// Exit if accessed directly. |
| 14 |
if ( ! defined( 'ABSPATH' ) ) { |
| 15 |
exit; |
| 16 |
} |
| 17 |
|
| 18 |
if ( ! class_exists( 'Charitable_Debugging' ) ) : |
| 19 |
|
| 20 |
/** |
| 21 |
* Charitable_Debugging |
| 22 |
* |
| 23 |
* @since 1.6.42 |
| 24 |
*/ |
| 25 |
class Charitable_Debugging { |
| 26 |
|
| 27 |
/** |
| 28 |
* Create class object. |
| 29 |
* |
| 30 |
* @since 1.6.42 |
| 31 |
*/ |
| 32 |
public function __construct() { |
| 33 |
/** |
| 34 |
* Automatically add Charitable's debugging constants when |
| 35 |
* using the WP Debugging plugin. |
| 36 |
*/ |
| 37 |
add_filter( 'wp_debugging_add_constants', array( $this, 'add_debugging_constants' ) ); |
| 38 |
} |
| 39 |
|
| 40 |
/** |
| 41 |
* Add debugging constants. |
| 42 |
* |
| 43 |
* @since 1.6.42 |
| 44 |
* |
| 45 |
* @param array $added_constants Collection of added constants. |
| 46 |
* @return array |
| 47 |
*/ |
| 48 |
public function add_debugging_constants( $added_constants ) { |
| 49 |
return array_merge( |
| 50 |
$added_constants, |
| 51 |
array( |
| 52 |
'charitable_debug' => array( 'value' => 'true' ) |
| 53 |
) |
| 54 |
); |
| 55 |
} |
| 56 |
} |
| 57 |
|
| 58 |
endif; |
| 59 |
|