@wordpress/editor
Version:
Enhanced block editor for WordPress posts.
37 lines (33 loc) • 868 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = PostURLLabel;
exports.usePostURLLabel = usePostURLLabel;
var _data = require("@wordpress/data");
var _url = require("@wordpress/url");
var _store = require("../../store");
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
/**
* Represents a label component for a post URL.
*
* @return {Component} The PostURLLabel component.
*/
function PostURLLabel() {
return usePostURLLabel();
}
/**
* Custom hook to get the label for the post URL.
*
* @return {string} The filtered and decoded post URL label.
*/
function usePostURLLabel() {
const postLink = (0, _data.useSelect)(select => select(_store.store).getPermalink(), []);
return (0, _url.filterURLForDisplay)((0, _url.safeDecodeURIComponent)(postLink));
}
//# sourceMappingURL=label.js.map