Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate receiveUploadPermissions #37508

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fallback to receiveUserPermission
  • Loading branch information
jiteshdhamaniya committed Dec 21, 2021
commit 6d719047a06aebcd23f57ce23e61cc88367e2775
4 changes: 4 additions & 0 deletions docs/reference-guides/data/data-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,10 @@ _Returns_

Returns an action object used in signalling that Upload permissions have been received.

_Parameters_

- _hasUploadPermissions_ `boolean`: Does the user have permission to upload files?

_Returns_

- `Object`: Action object.
Expand Down
4 changes: 4 additions & 0 deletions packages/core-data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ _Returns_

Returns an action object used in signalling that Upload permissions have been received.

_Parameters_

- _hasUploadPermissions_ `boolean`: Does the user have permission to upload files?

_Returns_

- `Object`: Action object.
Expand Down
8 changes: 4 additions & 4 deletions packages/core-data/src/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -698,16 +698,16 @@ export const __experimentalSaveSpecifiedEntityEdits = (
*
* @deprecated since WP 5.9, use receiveUserPermission instead.
*
* @param {boolean} hasUploadPermissions Does the user have permission to upload files?
*
* @return {Object} Action object.
*/
export function receiveUploadPermissions() {
export function receiveUploadPermissions( hasUploadPermissions ) {
deprecated( "wp.data.dispatch( 'core' ).receiveUploadPermissions", {
since: '5.9',
ntsekouras marked this conversation as resolved.
Show resolved Hide resolved
} );

return {
type: 'DO_NOTHING',
};
return receiveUserPermission( 'create/media', hasUploadPermissions );
}

/**
Expand Down