← All changes
|
includes/fields/class-charitable-object-fields.php
+6
-2
1.7.0.9
→
1.8.13
View file →
| @@ -3,9 +3,9 @@ | ||
| 3 | 3 | * Charitable Object Fields model. |
| 4 | 4 | * |
| 5 | 5 | * @package Charitable/Classes/Charitable_Object_Fields |
| 6 | 6 | * @author David Bisset |
| 7 | - * @copyright Copyright (c) 2022, WP Charitable LLC | |
| 7 | + * @copyright Copyright (c) 2023, WP Charitable LLC | |
| 8 | 8 | * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 9 | 9 | * @since 1.6.0 |
| 10 | 10 | * @version 1.6.0 |
| 11 | 11 | */ |
| @@ -69,9 +69,13 @@ | ||
| 69 | 69 | if ( ! $field ) { |
| 70 | 70 | return null; |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - return call_user_func( $field->value_callback, $this->object, $field_key ); | |
| 73 | + if ( is_callable( $field->value_callback ) ) { | |
| 74 | + return call_user_func( $field->value_callback, $this->object, $field_key ); | |
| 75 | + } | |
| 76 | + | |
| 77 | + return null; | |
| 74 | 78 | } |
| 75 | 79 | |
| 76 | 80 | /** |
| 77 | 81 | * Check whether a particular field is registered. |