Skip to content

Commit

Permalink
Add $data parameter to dokan_update_vendor hook
Browse files Browse the repository at this point in the history
- Added $data array as second parameter to dokan_update_vendor action hook
- Updated doc block for dokan_update_vendor hook to reflect new parameter
- Added doc block for dokan_before_update_vendor hook
  • Loading branch information
mralaminahamed committed Oct 3, 2024
1 parent 191b7f8 commit 2e7463c
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion includes/Vendor/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,27 @@ public function update( $vendor_id, $data = [] ) {
}
}

/**
* Fires before a vendor is updated.
*
* @since [insert version number here]
*
* @param int $vendor_id The ID of the vendor being updated.
* @param array $data The array of vendor data being updated.
*/
do_action( 'dokan_before_update_vendor', $vendor->get_id(), $data );

$vendor->save();

do_action( 'dokan_update_vendor', $vendor->get_id() );
/**
* Fires after a vendor has been updated.
*
* @since [insert version number here]
*
* @param int $vendor_id The ID of the vendor that was updated.
* @param array $data The array of vendor data that was updated.
*/
do_action( 'dokan_update_vendor', $vendor->get_id(), $data );

return $vendor->get_id();
}
Expand Down

0 comments on commit 2e7463c

Please sign in to comment.