mirror of
https://gh.wpcy.net/https://github.com/WP-Autoplugin/hub2wp-repo-public.git
synced 2026-04-25 17:03:14 +08:00
10 lines
474 B
JavaScript
10 lines
474 B
JavaScript
export function formatPluginName(name) {
|
|
let displayName = name.replace(/-/g, ' ');
|
|
displayName = displayName.replace(/wp/g, 'WP');
|
|
displayName = displayName.replace(/wordpress/g, 'WordPress');
|
|
displayName = displayName.replace(/seo/g, 'SEO');
|
|
displayName = displayName.replace(/\b\w/g, c => c.toUpperCase());
|
|
displayName = displayName.replace(/Hub2WP/g, 'hub2wp');
|
|
displayName = displayName.replace(/WP Autoplugin/g, 'WP-Autoplugin');
|
|
return displayName;
|
|
}
|