Skip to content

Commit

Permalink
Fixes #364
Browse files Browse the repository at this point in the history
  • Loading branch information
devin committed Dec 22, 2015
1 parent df4fc46 commit 8336b85
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions includes/admin/register-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ) );
Expand Down Expand Up @@ -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 "<pre>";
var_dump($object_id);
var_dump($updated);
var_dump($cmb_id);
var_dump($cmb);
var_dump(did_action( 'cmb2_save_options-page_fields' ));
echo "</pre>";
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' );

}

Expand Down Expand Up @@ -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;

}
Expand Down

0 comments on commit 8336b85

Please sign in to comment.