[ SYSTEM ]: Linux wordpress 6.1.0-44-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.164-1 (2026-03-09) x86_64
[ SERVER ]: Apache/2.4.66 (Debian) | PHP: 8.2.30
[ USER ]: www-data | IP: 172.19.30.54
GEFORCE FILE MANAGER
/
var
/
www
/
html
/
wordpress
/
wp-content
/
plugins
/
presto-player
/
src
/
admin
/
blocks
/
shared
/
UPLOAD:
NAME
SIZE
QUICK PERMS
ACTIONS
📁 MediaProviders
SET
[ DEL ]
📁 ProvidersPlaceholder
SET
[ DEL ]
📁 audioPresets
SET
[ DEL ]
📁 branding
SET
[ DEL ]
📁 chapters
SET
[ DEL ]
📁 components
SET
[ DEL ]
📁 media
SET
[ DEL ]
📁 overlays
SET
[ DEL ]
📁 presets
SET
[ DEL ]
📁 services
SET
[ DEL ]
📁 settings
SET
[ DEL ]
📁 styles
SET
[ DEL ]
📁 tracks
SET
[ DEL ]
📄 BlockInspectorControls.js
3,307 B
SET
[ EDIT ]
|
[ DEL ]
📄 Editing.js
544 B
SET
[ EDIT ]
|
[ DEL ]
📄 LinkPlaceholder.js
1,316 B
SET
[ EDIT ]
|
[ DEL ]
📄 Player.js
5,229 B
SET
[ EDIT ]
|
[ DEL ]
📄 Preview.js
4,252 B
SET
[ EDIT ]
|
[ DEL ]
📄 ProUpgradeModal.js
870 B
SET
[ EDIT ]
|
[ DEL ]
📄 VisibilityEditor.js
1,939 B
SET
[ EDIT ]
|
[ DEL ]
📄 audio-placeholder.js
6,173 B
SET
[ EDIT ]
|
[ DEL ]
📄 helpers.js
942 B
SET
[ EDIT ]
|
[ DEL ]
📄 options.js
1,578 B
SET
[ EDIT ]
|
[ DEL ]
📄 placeholder.js
6,353 B
SET
[ EDIT ]
|
[ DEL ]
DELETE SELECTED
[ CLOSE ]
EDIT: options.js
const { useEffect, useState } = wp.element; const { useSelect } = wp.data; import { usePrevious } from "@/admin/blocks/util"; export default function ({ attributes, setAttributes }) { const { chapters, poster } = attributes; const [presetData, setPresetData] = useState({}); const data = { branding: {}, loading: false, presets: [], presetData: {}, }; data.branding = useSelect((select) => { return select("presto-player/player").branding(); }); useEffect(() => { document.body.style.setProperty("--plyr-color-main", data.branding?.color); }, [data.branding?.color]); data.loading = useSelect((select) => { return select("presto-player/player").presetsLoading(); }); data.presets = useSelect((select) => { return select("presto-player/player").getPresets(); }); // set preset data when presets are loaded useEffect(() => { const thisPreset = data.presets.find((preset) => { return preset.id === attributes?.preset; }); data.presetData = thisPreset; }, [data.presets, attributes?.preset]); // This will reload the player to show the controls let [count, setCount] = useState(1); useEffect(() => { setCount(count + 1); }, [poster, data.presetData]); // re-render only if times change const prevChapters = usePrevious(chapters); useEffect(() => { let times = chapters?.map((item) => item.time); let prevTimes = prevChapters?.map((item) => item.time); if (_.difference(times, prevTimes).length) { setCount(count + 1); } }, [chapters]); return data; }