How to use the @wordpress/url.safeDecodeURIComponent function in @wordpress/url

To help you get started, we’ve selected a few @wordpress/url examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github WordPress / gutenberg / packages / editor / src / components / post-publish-modal / postpublish.js View on Github external
/* translators: %s: post type singular name */
							__( 'Great Work! You\'ve just published your first %s. You can review it here to check for any mistakes, or start on a new %s.' ), postLabel, postLabel
						)
					}
				<p></p>
				<div>
					
					
						{ this.state.showCopyConfirmation ? __( 'Copied!' ) : __( 'Copy Link' ) }
					
				</div>
				{ ! isScheduled &amp;&amp; (
					<div>
						</div>
github WordPress / gutenberg / packages / editor / src / components / post-publish-panel / postpublish.js View on Github external
<div>
				
					<a href="{">{ post.title || __( '(no title)' ) }</a> { postPublishNonLinkHeader }
				
				
					<p>
						<strong>{ __( 'What’s next?' ) }</strong>
					</p>
					
					<div>
						{ ! isScheduled &amp;&amp; (
							<button href="{">
								{ viewPostLabel }
							</button>
						) }

						
							{ this.state.showCopyConfirmation ? __( 'Copied!' ) : __( 'Copy Link' ) }
						
					</div>
				
				{ children }
			</div>
github WordPress / gutenberg / packages / edit-post / src / components / sidebar / post-link / index.js View on Github external
isOpened,
	onTogglePanel,
	isEditable,
	postLink,
	permalinkParts,
	editPermalink,
	forceEmptyField,
	setState,
	postTitle,
	postSlug,
	postID,
	postTypeLabel,
} ) {
	const { prefix, suffix } = permalinkParts;
	let prefixElement, postNameElement, suffixElement;
	const currentSlug = safeDecodeURIComponent( postSlug ) || cleanForSlug( postTitle ) || postID;
	if ( isEditable ) {
		prefixElement = prefix &amp;&amp; (
			<span>{ prefix }</span>
		);
		postNameElement = currentSlug &amp;&amp; (
			<span>{ currentSlug }</span>
		);
		suffixElement = suffix &amp;&amp; (
			<span>{ suffix }</span>
		);
	}

	return (
github WordPress / gutenberg / packages / editor / src / components / post-permalink / index.js View on Github external
permalinkParts,
			postLink,
			postSlug,
			postID,
			postTitle,
		} = this.props;

		if ( isNew || ! isViewable || ! permalinkParts || ! postLink ) {
			return null;
		}

		const { isCopied, isEditingPermalink } = this.state;
		const ariaLabel = isCopied ? __( 'Permalink copied' ) : __( 'Copy the permalink' );

		const { prefix, suffix } = permalinkParts;
		const slug = safeDecodeURIComponent( postSlug ) || cleanForSlug( postTitle ) || postID;
		const samplePermalink = ( isEditable ) ? prefix + slug + suffix : prefix;

		return (
			<div>
				 this.setState( { isCopied: true } ) }
					aria-disabled={ isCopied }
					icon="admin-links"
				/&gt;

				<span>{ __( 'Permalink:' ) }</span>

				{ ! isEditingPermalink &amp;&amp;</div>