From 8336b856bc51867555a9ff0eb3150d495d35c8f9 Mon Sep 17 00:00:00 2001 From: devin Date: Mon, 21 Dec 2015 21:16:41 -0800 Subject: [PATCH] Fixes #364 --- includes/admin/register-settings.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/includes/admin/register-settings.php b/includes/admin/register-settings.php index 02ff8ee435..b545a9df0a 100644 --- a/includes/admin/register-settings.php +++ b/includes/admin/register-settings.php @@ -57,7 +57,7 @@ public function __construct() { add_action( 'cmb2_render_system_info', 'give_system_info_callback', 10, 5 ); add_action( 'cmb2_render_api', 'give_api_callback', 10, 5 ); add_action( 'cmb2_render_license_key', 'give_license_key_callback', 10, 5 ); - add_action( "cmb2_save_options-page_fields", array( $this, 'settings_notices' ), 10, 3 ); + add_action( 'cmb2_save_options-page_fields', array( $this, 'settings_notices' ), 10, 4 ); // Include CMB CSS in the head to avoid FOUC add_action( "admin_print_styles-give_forms_page_give-settings", array( 'CMB2_hookup', 'enqueue_cmb_css' ) ); @@ -685,18 +685,27 @@ public function give_settings( $active_tab ) { * @param $updated * @param $cmb */ - public function settings_notices( $object_id, $updated, $cmb ) { + public function settings_notices( $object_id, $cmb_id, $updated, $cmb ) { //Sanity check if ( $object_id !== $this->key ) { return; } - +echo "
";
+var_dump($object_id);
+var_dump($updated);
+var_dump($cmb_id);
+var_dump($cmb);
+var_dump(did_action( 'cmb2_save_options-page_fields' ));
+echo "
"; if ( did_action( 'cmb2_save_options-page_fields' ) === 1 ) { - settings_errors( 'give-notices' ); +// settings_errors( 'give-notices' ); + echo 'hello'; } - add_settings_error( 'give-notices', 'global-settings-updated', __( 'Settings updated.', 'give' ), 'updated' ); + + +// add_settings_error( 'give-notices', 'global-settings-updated', __( 'Settings updated.', 'give' ), 'updated' ); } @@ -1007,7 +1016,6 @@ function give_description_callback( $field_object, $escaped_value, $object_id, $ $field_description = $field_type_object->field->args['desc']; - echo $field_description; }