Hooks and Filters
Filters
Section titled “Filters”wpify_woo_dpd_get_branches
Section titled “wpify_woo_dpd_get_branches”Filter the list of DPD branches (parcel shops and pickup points) returned from the API.
apply_filters( 'wpify_woo_dpd_get_branches', array $shops );Parameters:
| Parameter | Type | Description |
|---|---|---|
$shops | array | Array of branch data from the DPD API |
Example — filter branches by city:
/** * Show only branches in Prague * * @param array $shops Branches from DPD API * @return array */function my_dpd_filter_branches( $shops ) { return array_filter( $shops, function ( $shop ) { return $shop['city'] === 'Praha'; } );}add_filter( 'wpify_woo_dpd_get_branches', 'my_dpd_filter_branches' );REST API
Section titled “REST API”The plugin registers the following REST API endpoints under the wpify-woo-dpd/v1 namespace:
| Method | Endpoint | Description | Permission |
|---|---|---|---|
| POST | /admin/packages-no | Update the number of packages for an order | manage_woocommerce |
| POST | /admin/address | Update the sender address for an order | manage_woocommerce |
| POST | /orders | Submit orders to DPD | manage_woocommerce |
| GET | /branches | Public | |
| POST | /option | Save plugin options | manage_woocommerce |
Where to Place Your Code
Section titled “Where to Place Your Code”You can add custom functions either in your child theme’s functions.php or use the Code Snippets plugin.