@wordpress/block-library
Version:
Block library for the WordPress editor.
20 lines (19 loc) • 586 B
JavaScript
/**
* WordPress dependencies
*/
import { useSelect } from '@wordpress/data';
import { store as coreStore } from '@wordpress/core-data';
/**
* Returns whether the current user can edit the given entity.
*
* @param {string} kind Entity kind.
* @param {string} name Entity name.
* @param {string} recordId Record's id.
*/
export function useCanEditEntity(kind, name, recordId) {
return useSelect(select => select(coreStore).canUserEditEntityRecord(kind, name, recordId), [kind, name, recordId]);
}
export default {
useCanEditEntity
};
//# sourceMappingURL=hooks.js.map