X7ROOT File Manager
Current Path:
/home/notabjze/pyirates.net/wp-content/plugins/extendify/src/Launch/lib
home
/
notabjze
/
pyirates.net
/
wp-content
/
plugins
/
extendify
/
src
/
Launch
/
lib
/
ðŸ“
..
📄
blocks.js
(417 B)
📄
linkPages.js
(3.13 KB)
📄
logo.js
(674 B)
📄
pages.js
(1.82 KB)
📄
parsing.js
(109 B)
📄
util.js
(930 B)
📄
wp.js
(3.67 KB)
Editing: logo.js
import { uploadMedia } from '@wordpress/media-utils'; import { getFilename } from '@wordpress/url'; import { getOption, updateOption } from '@launch/api/WPApi'; export const uploadLogo = async (url) => { await getOption('site_logo').then(async (id) => { if (!parseInt(id)) { const name = getFilename(url) ?? 'default-logo.png'; const blob = await (await fetch(url)).blob(); await uploadMedia({ filesList: [ new File([blob], name, { type: 'image/x-png', }), ], onFileChange: async ([fileObj]) => { if (fileObj.id) { await updateOption('site_logo', fileObj.id); } }, onError: console.error, }); } }); };
Upload File
Create Folder