| Server IP : 185.252.147.100 / Your IP : 216.73.217.33 Web Server : nginx/1.27.3 System : Linux mitrofanov.ru 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1 (2025-05-22) x86_64 User : mitr ( 1000) PHP Version : 8.2.29 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /www/html/fast-franchise.ru/wordpress/wp-content/plugins/generateblocks/src/blocks/headline/ |
Upload File : |
/**
* Block: Headline
*/
import classnames from 'classnames';
import Element from '../../components/element';
import { RichText, useBlockProps } from '@wordpress/block-editor';
import { applyFilters } from '@wordpress/hooks';
import IconWrapper from '../../components/icon-wrapper';
export default ( { attributes } ) => {
const {
uniqueId,
anchor,
element,
content,
icon,
hasIcon,
removeText,
} = attributes;
let htmlAttributes = {
className: classnames( {
'gb-headline': true,
[ `gb-headline-${ uniqueId }` ]: true,
'gb-headline-text': ! hasIcon,
} ),
id: anchor ? anchor : null,
};
htmlAttributes = applyFilters(
'generateblocks.frontend.htmlAttributes',
htmlAttributes,
'generateblocks/headline',
attributes
);
const blockProps = useBlockProps.save( htmlAttributes );
return (
<Element tagName={ element } htmlAttrs={ blockProps }>
<IconWrapper
hasIcon={ hasIcon }
icon={ icon }
hideChildren={ removeText }
showWrapper={ false }
>
<RichText.Content
value={ content }
tagName={ hasIcon && icon ? 'span' : undefined }
className={ hasIcon && icon ? 'gb-headline-text' : undefined }
/>
</IconWrapper>
</Element>
);
};