@wordpress/editor
Version:
Enhanced block editor for WordPress posts.
37 lines (33 loc) • 880 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = PostVisibilityLabel;
exports.usePostVisibilityLabel = usePostVisibilityLabel;
var _data = require("@wordpress/data");
var _utils = require("./utils");
var _store = require("../../store");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Returns the label for the current post visibility setting.
*
* @return {string} Post visibility label.
*/
function PostVisibilityLabel() {
return usePostVisibilityLabel();
}
/**
* Get the label for the current post visibility setting.
*
* @return {string} Post visibility label.
*/
function usePostVisibilityLabel() {
const visibility = (0, _data.useSelect)(select => select(_store.store).getEditedPostVisibility());
return _utils.visibilityOptions[visibility]?.label;
}
//# sourceMappingURL=label.js.map