Skip to content

Commit bf1546d

Browse files
chore: Release version 4.2.5
Merge branch 'release/4.2.5'
2 parents b9c27ff + e941b8f commit bf1546d

File tree

22 files changed

+1882
-406
lines changed

22 files changed

+1882
-406
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
### v4.2.5 ( Jan 05, 2026 ) ###
2+
- **fix:** Add translation support to store performance report labels.
3+
- **fix:** Social profile URL's not accessible for staff users.
4+
- **fix:** Prevented unauthorized changes to administrator accounts.
5+
16
### v4.2.4 ( Dec 26, 2025 ) ###
27
- **new:** Added a Pending Vendors tab on the WordPress admin Users screen to view vendors awaiting approval.
38
- **new:** Added a bulk action on the WordPress admin Users screen to approve multiple pending vendors at once, including per-user validation and permission checks.

composer.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/frontend/stores.md

Lines changed: 122 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,27 +225,145 @@ the global `dokan.{store-name}-store` when your code is bundled.
225225

226226
The `Dokan Core Store` is a `WordPress Data Store` that provides access to the core data of the `Dokan` plugin. This store is available in the `@dokan/stores/core` package.
227227

228+
## Available Selectors
229+
230+
The core store provides the following selectors:
231+
232+
- `getCurrentUser()` - Get the current user object
233+
- `hasCap(capability)` - Check if the current user has a specific capability
234+
- `isVendor()` - Check if the current user is a vendor
235+
- `isVendorStaff()` - Check if the current user is a vendor staff
236+
- `getStoreSettings()` - Get the store settings
237+
- `getGlobalSettings()` - Get the global settings
238+
- `getVendorId()` - Get the vendor ID for the current user
239+
240+
## Available Actions
241+
242+
- `setCurrentUser(user)` - Set the current user
243+
- `setStoreSettings(settings)` - Set the store settings
244+
- `setGlobalSettings(settings)` - Set the global settings
245+
246+
## Usage Examples
247+
248+
### Using Selectors
249+
228250
```js
229251
import { useSelect } from '@wordpress/data';
230252
import coreStore from '@dokan/stores/core';
231253

232254
const App = () => {
255+
// Get current user
256+
const currentUser = useSelect( ( select ) => {
257+
return select( coreStore ).getCurrentUser();
258+
}, [] );
259+
260+
// Check if user is a vendor
261+
const isVendor = useSelect( ( select ) => {
262+
return select( coreStore ).isVendor();
263+
}, [] );
264+
265+
// Check if user is a vendor staff
233266
const isVendorStaff = useSelect( ( select ) => {
234267
return select( coreStore ).isVendorStaff();
235268
}, [] );
236-
237-
const getStoreSettings = useSelect( ( select ) => {
269+
270+
// Check if user has a specific capability
271+
const hasCapability = useSelect( ( select ) => {
272+
return select( coreStore ).hasCap( 'dokandar' );
273+
}, [] );
274+
275+
// Get store settings
276+
const storeSettings = useSelect( ( select ) => {
238277
return select( coreStore ).getStoreSettings();
239278
}, [] );
240279

241-
const currentUser = useSelect( ( select ) => {
242-
return select( coreStore ).getCurrentUser();
280+
// Get global settings
281+
const globalSettings = useSelect( ( select ) => {
282+
return select( coreStore ).getGlobalSettings();
243283
}, [] );
284+
285+
// Get vendor ID
286+
const vendorId = useSelect( ( select ) => {
287+
return select( coreStore ).getVendorId();
288+
}, [] );
289+
};
290+
```
291+
292+
### Using Actions
293+
294+
```js
295+
import { useDispatch } from '@wordpress/data';
296+
import coreStore from '@dokan/stores/core';
297+
298+
const App = () => {
299+
const { setCurrentUser, setStoreSettings, setGlobalSettings } = useDispatch( coreStore );
300+
301+
// Update current user
302+
const updateUser = ( user ) => {
303+
setCurrentUser( user );
304+
};
305+
306+
// Update store settings
307+
const updateStoreSettings = ( settings ) => {
308+
setStoreSettings( settings );
309+
};
310+
311+
// Update global settings
312+
const updateGlobalSettings = ( settings ) => {
313+
setGlobalSettings( settings );
314+
};
315+
};
316+
```
317+
318+
### Using Resolvers (Async Data Fetching)
319+
320+
```js
321+
import { resolveSelect } from '@wordpress/data';
322+
import coreStore from '@dokan/stores/core';
323+
324+
const App = () => {
325+
// Fetch current user asynchronously
326+
const fetchCurrentUser = async () => {
327+
await resolveSelect( coreStore ).getCurrentUser();
328+
};
329+
330+
// Fetch store settings asynchronously
331+
const fetchStoreSettings = async () => {
332+
const settings = await resolveSelect( coreStore ).getStoreSettings();
333+
return settings;
334+
};
335+
336+
// Fetch global settings asynchronously
337+
const fetchGlobalSettings = async () => {
338+
await resolveSelect( coreStore ).getGlobalSettings();
339+
};
340+
341+
// Check capability (triggers user fetch if needed)
342+
const checkCapability = async ( capability ) => {
343+
await resolveSelect( coreStore ).hasCap( capability );
344+
};
345+
346+
// Check if vendor (triggers user fetch if needed)
347+
const checkIsVendor = async () => {
348+
await resolveSelect( coreStore ).isVendor();
349+
};
350+
351+
// Check if vendor staff (triggers user fetch if needed)
352+
const checkIsVendorStaff = async () => {
353+
await resolveSelect( coreStore ).isVendorStaff();
354+
};
355+
356+
// Get vendor ID (triggers user fetch if needed)
357+
const fetchVendorId = async () => {
358+
await resolveSelect( coreStore ).getVendorId();
359+
};
244360
};
245361
```
246362

247363
## Use Dokan Hooks
248364

365+
For convenience, you can also use the Dokan hooks which provide a simpler API:
366+
249367
```js
250368
import { usePermission, useCurrentUser } from '@dokan/hooks';
251369

@@ -259,5 +377,4 @@ const App = () => {
259377
const isDokandar = usePermission('dokandar'); // you can pass string as single permission or pass string[] array for multiple permission checking
260378
const currentUser = useCurrentUser();
261379
}
262-
263380
```

dokan-class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ final class WeDevs_Dokan {
2525
*
2626
* @var string
2727
*/
28-
public $version = '4.2.4';
28+
public $version = '4.2.5';
2929

3030
/**
3131
* Instance of self

dokan.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Dokan
44
* Plugin URI: https://dokan.co/wordpress/
55
* Description: An e-commerce marketplace plugin for WordPress. Powered by WooCommerce and weDevs.
6-
* Version: 4.2.4
6+
* Version: 4.2.5
77
* Author: Dokan Inc.
88
* Author URI: https://dokan.co/wordpress/
99
* Text Domain: dokan-lite

includes/DependencyManagement/Providers/CommonServiceProvider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class CommonServiceProvider extends BaseServiceProvider {
2525
\WeDevs\Dokan\Order\RefundHandler::class,
2626
\WeDevs\Dokan\Exceptions\Handler::class,
2727
\WeDevs\Dokan\Shortcodes\FullWidthVendorLayout::class,
28+
\WeDevs\Dokan\Vendor\ApiMeta::class,
2829
];
2930

3031
/**

0 commit comments

Comments
 (0)