import { __ } from '@wordpress/i18n'; import { registerBlockType } from '@wordpress/blocks'; import { InspectorControls, useBlockProps } from '@wordpress/block-editor'; import { CheckboxControl, PanelBody, SelectControl, TextControl } from '@wordpress/components'; import ServerSideRender from '@wordpress/server-side-render'; registerBlockType( 'friends/friends-list', { apiVersion: 2, edit: function( { attributes, setAttributes } ) { const blockProps = useBlockProps(); return ( <> setAttributes( { users_inline } ) } /> setAttributes( { user_types } ) } value={ attributes.user_types } options={ [ { label: __( 'Friends', 'friends' ), value: 'friends', }, { label: __( 'Friend requests', 'friends' ), value: 'friend_requests', }, { label: __( 'Subscriptions', 'friends' ), value: 'subscriptions', }, { label: __( 'Friends + Subscriptions', 'friends' ), value: 'friends_subscriptions', }, ] } />
); }, save() { return null; }, } );