How to use the @wordpress/url.removeQueryArgs 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 Automattic / wp-calypso / apps / full-site-editing / full-site-editing-plugin / starter-page-templates / page-template-modal / utils / ensure-assets.js View on Github external
const addAssetToLoad = ( assets, url, usages ) => {
	// Remove resizing query arguments from the URL.
	url = removeQueryArgs( url, 'w', 's' );

	// Use an existing asset for the URL or make a new one.
	const asset = assets[ url ] || {
		url,
		usages: [],
	};

	// Return new result object, extended with the new/updated asset.
	return {
		...assets,
		[ url ]: {
			...asset,
			// Store where exactly block uses id/url so we can update it later.
			usages: [ ...asset.usages, ...usages ],
		},
	};
github ampproject / amp-wp / assets / src / admin / paired-browsing / app.js View on Github external
removeAmpQueryVars( url ) {
		return removeQueryArgs( url, ampSlug, ampPairedBrowsingQueryVar, ampValidationErrorsQueryVar );
	}
github woocommerce / woocommerce-gutenberg-products-block / assets / js / base / hooks / use-url-query-string.js View on Github external
const removeWindowHistory = ( keys, queryStateContext ) => {
	if ( hasWindowDependencies ) {
		keys = keys.map( ( key ) => `${ key }_${ queryStateContext }` );
		const existingUrl = window.location.href;
		const newUrl = removeQueryArgs( window.location.href, ...keys );
		if ( newUrl !== existingUrl ) {
			window.history.pushState( null, '', newUrl );
		}
	}
};
github Automattic / wp-calypso / client / landing / gutenboarding / onboarding-block / design-selector / page-layout-selector.tsx View on Github external
{ templates.map( template => (
					 selectLayout( template ) }
						key={ template.slug }
					>
						<div>
							
						</div>
						
							<img src="{" alt="{">
						
					
				) ) }
github Automattic / wp-calypso / client / landing / gutenboarding / onboarding-block / design-selector / design-card.tsx View on Github external
const DesignCard: FunctionComponent&lt; Props &gt; = ( { design, onClick, isSelected, style } ) =&gt; (
	
		
			<img srcset="{" src="{" alt="{" height="{" width="{">
		
	
);