| Server IP : 141.193.213.11 / Your IP : 216.73.216.101 Web Server : nginx System : Linux pod-400555 6.8.0-1055-gke #61-Ubuntu SMP Tue May 26 22:57:42 UTC 2026 x86_64 User : fpm200079 ( 200079) PHP Version : 8.2.36 Disable Function : apache_child_terminate,apache_get_modules,apache_get_version,apache_getenv,apache_note,apache_setenv,disk_free_space,disk_total_space,diskfreespace,dl,exec,fastcgi_finish_request,link,opcache_compile_file,opcache_get_configuration,opcache_invalidate,opcache_is_script_cached,opcache_reset,passthru,pclose,pcntl_exec,popen,posix_getpid,posix_getppid,posix_getpwuid,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_uname,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,realpath_cache_get,shell_exec,show_source,symlink,system MySQL : OFF | cURL : ON | WGET : OFF | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /nas/content/live/bartislaw/wp-content/plugins/ubermenu/includes/gutenberg/src/ |
Upload File : |
/**
* Retrieves the translation of text.
*
* @see https://developer.wordpress.org/block-editor/packages/packages-i18n/
*/
import { __ } from '@wordpress/i18n';
/**
* React hook that is used to mark the block wrapper element.
* It provides all the necessary props like the class name.
*
* @see https://developer.wordpress.org/block-editor/packages/packages-block-editor/#useBlockProps
*/
import { useBlockProps, InspectorControls } from '@wordpress/block-editor';
import { SelectControl, PanelBody } from '@wordpress/components';
import { Fragment } from '@wordpress/element';
import ServerSideRender from '@wordpress/server-side-render';
/**
* Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files.
* Those files can contain any CSS code that gets applied to the editor.
*
* @see https://www.npmjs.com/package/@wordpress/scripts#using-css
*/
// import './editor.scss';
/**
* The edit function describes the structure of your block in the context of the
* editor. This represents what the editor will render when the block is used.
*
* @see https://developer.wordpress.org/block-editor/developers/block-api/block-edit-save/#edit
*
* @return {WPElement} Element to render.
*/
export default function Edit({ attributes, setAttributes }) {
const menuOptions = Object.keys(
window.ubermenu_block.menu_options
).map((menuId) => {
return {
value: menuId,
label: window.ubermenu_block.menu_options[menuId],
};
});
const configOptions = Object.keys(
window.ubermenu_block.config_options
).map((configId) => {
return {
value: configId,
label: window.ubermenu_block.config_options[configId],
};
});
return (
<Fragment>
<InspectorControls>
<PanelBody>
<SelectControl
label={__('Menu')}
value={attributes.menuId}
onChange={(value) =>
setAttributes({ menuId: +value })
}
options={menuOptions}
/>
<SelectControl
label={__('Configuration')}
value={attributes.configId}
onChange={(value) =>
setAttributes({ configId: value })
}
options={configOptions}
/>
</PanelBody>
</InspectorControls>
<div {...useBlockProps()} >
<ServerSideRender
block="ubermenu/ubermenu-block"
attributes={attributes}
/>
</div>
</Fragment>
);
}