WC_Admin_API_Keys::allow_save_settings │ public │ WC 1.0

Check if should allow save settings. This prevents "Your settings have been saved." notices on the table list.

Method of the class: WC_Admin_API_Keys{}

No Hooks.

Returns

bool.

Usage

$WC_Admin_API_Keys = new WC_Admin_API_Keys();
$WC_Admin_API_Keys->allow_save_settings( $allow );
$allow(true|false) (required)
If allow save settings.

WC_Admin_API_Keys::allow_save_settings() code WC 11.3.0

public function allow_save_settings( $allow ) {
	if ( ! isset( $_GET['create-key'], $_GET['edit-key'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only routing; mutation helpers verify nonces and capabilities.
		return false;
	}

	return $allow;
}