golden hour
/home/godaofbq/dialhyperbaric.com/wp-content/plugins/code-snippets/js/utils
⬆️ Go Up
Upload
File/Folder
Size
Actions
api
-
Del
OK
files.ts
1.01 KB
Del
OK
general.ts
433 B
Del
OK
shortcodes.ts
346 B
Del
OK
snippets.ts
986 B
Del
OK
Edit: shortcodes.ts
export type ShortcodeAtts = Record<string, unknown> export const buildShortcodeTag = (tag: string, atts: ShortcodeAtts): string => `[${[ tag, ...Object.entries(atts) .filter(([, value]) => Boolean(value)) .map(([att, value]) => 'boolean' === typeof value ? att : `${att}=${JSON.stringify(value)}`) ].filter(Boolean).join(' ')}]`
Save