setAttributes(
{
profileImgID: img.id,
profileImgURL: img.url,
}
) }
allowed={ ALLOWED_MEDIA_TYPES }
type="image"
value={ profileImgID }
render={ ( { open } ) => (
) }
>
setAttributes( { profileName: value } ) }
/>
setAttributes( { profileTitle: value } ) }
/>
setAttributes( { profileContent: value } ) }
/>
];
}
}
// Register the block
registerBlockType( 'atomic-blocks/ab-profile-box', {
title: __( 'AB Profile Box', 'atomic-blocks' ),
description: __( 'Add a profile box with bio info and social media links.', 'atomic-blocks' ),
icon: 'admin-users',
category: 'atomic-blocks',
keywords: [
__( 'author', 'atomic-blocks' ),
__( 'profile', 'atomic-blocks' ),
__( 'atomic', 'atomic-blocks' ),
],
// Setup the block attributes
attributes: blockAttributes,
// Render the block components
edit: ABAuthorProfileBlock,
// Save the block markup
save: function( props ) {
// Setup the attributes
const { profileName, profileTitle, profileContent, profileAlignment, profileImgURL, profileImgID, profileFontSize, profileBackgroundColor, profileTextColor, profileLinkColor, twitter, facebook, instagram, pinterest, google, youtube, github, linkedin, email, website, profileAvatarShape } = props.attributes;
return (
// Save the block markup for the front end