passing classes to caption and description
This commit is contained in:
parent
1e11b07f35
commit
d6471edb8e
|
|
@ -1 +1 @@
|
||||||
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '86470840525466393d70');
|
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '3356560b010309d5ab53');
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,6 @@ function ImagePanelBody({
|
||||||
setAttributes
|
setAttributes
|
||||||
}) {
|
}) {
|
||||||
function setImageAttributes(image) {
|
function setImageAttributes(image) {
|
||||||
console.log(image);
|
|
||||||
setAttributes({
|
setAttributes({
|
||||||
imageId: image.id,
|
imageId: image.id,
|
||||||
imageAlt: image.alt,
|
imageAlt: image.alt,
|
||||||
|
|
@ -270,7 +269,11 @@ function Edit({
|
||||||
imageAlt: imageAlt,
|
imageAlt: imageAlt,
|
||||||
imageUrl: imageUrl,
|
imageUrl: imageUrl,
|
||||||
imageProportion: imageProportion
|
imageProportion: imageProportion
|
||||||
}), imageDescription && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, imageDescription), imageCaption && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, imageCaption))), contentDisposition === "right" && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
}), imageDescription && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
|
||||||
|
className: "picture_description"
|
||||||
|
}, imageDescription), imageCaption && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
|
||||||
|
className: "picture_caption"
|
||||||
|
}, imageCaption))), contentDisposition === "right" && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
||||||
className: "homegrade-blocks-text-image__column homegrade-blocks-text-image__column--image"
|
className: "homegrade-blocks-text-image__column homegrade-blocks-text-image__column--image"
|
||||||
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_components_ImageMediaPlaceholder__WEBPACK_IMPORTED_MODULE_3__["default"], {
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_components_ImageMediaPlaceholder__WEBPACK_IMPORTED_MODULE_3__["default"], {
|
||||||
imageAlt: imageAlt,
|
imageAlt: imageAlt,
|
||||||
|
|
@ -282,7 +285,11 @@ function Edit({
|
||||||
imageAlt: imageAlt,
|
imageAlt: imageAlt,
|
||||||
imageUrl: imageUrl,
|
imageUrl: imageUrl,
|
||||||
imageProportion: imageProportion
|
imageProportion: imageProportion
|
||||||
}), imageDescription && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, imageDescription), imageCaption && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, imageCaption)), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
}), imageDescription && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
|
||||||
|
className: "picture_description"
|
||||||
|
}, imageDescription), imageCaption && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
|
||||||
|
className: "picture_caption"
|
||||||
|
}, imageCaption)), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
||||||
className: "homegrade-blocks-text-image__column homegrade-blocks-text-image__column--text"
|
className: "homegrade-blocks-text-image__column homegrade-blocks-text-image__column--text"
|
||||||
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_6__.InnerBlocks, {
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_6__.InnerBlocks, {
|
||||||
template: [["core/paragraph", {
|
template: [["core/paragraph", {
|
||||||
|
|
@ -375,13 +382,21 @@ function save({
|
||||||
imageAlt: imageAlt,
|
imageAlt: imageAlt,
|
||||||
imageUrl: imageUrl,
|
imageUrl: imageUrl,
|
||||||
imageProportion: imageProportion
|
imageProportion: imageProportion
|
||||||
}), imageDescription && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, imageDescription), imageCaption && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, imageCaption))), contentDisposition === "right" && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
}), imageDescription && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
|
||||||
|
className: "picture_description"
|
||||||
|
}, imageDescription), imageCaption && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
|
||||||
|
className: "picture_caption"
|
||||||
|
}, imageCaption))), contentDisposition === "right" && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
||||||
className: "homegrade-blocks-text-image__column homegrade-blocks-text-image__column--image"
|
className: "homegrade-blocks-text-image__column homegrade-blocks-text-image__column--image"
|
||||||
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_components_Image__WEBPACK_IMPORTED_MODULE_2__["default"], {
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_components_Image__WEBPACK_IMPORTED_MODULE_2__["default"], {
|
||||||
imageAlt: imageAlt,
|
imageAlt: imageAlt,
|
||||||
imageUrl: imageUrl,
|
imageUrl: imageUrl,
|
||||||
imageProportion: imageProportion
|
imageProportion: imageProportion
|
||||||
}), imageDescription && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, imageDescription), imageCaption && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, imageCaption)), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
}), imageDescription && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
|
||||||
|
className: "picture_description"
|
||||||
|
}, imageDescription), imageCaption && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", {
|
||||||
|
className: "picture_caption"
|
||||||
|
}, imageCaption)), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", {
|
||||||
className: "homegrade-blocks-text-image__column homegrade-blocks-text-image__column--text"
|
className: "homegrade-blocks-text-image__column homegrade-blocks-text-image__column--text"
|
||||||
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks.Content, null))));
|
}, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InnerBlocks.Content, null))));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -108,8 +108,12 @@ export default function Edit({ attributes, setAttributes, ...props }) {
|
||||||
imageUrl={imageUrl}
|
imageUrl={imageUrl}
|
||||||
imageProportion={imageProportion}
|
imageProportion={imageProportion}
|
||||||
/>
|
/>
|
||||||
{imageDescription && <p>{imageDescription}</p>}
|
{imageDescription && (
|
||||||
{imageCaption && <p>{imageCaption}</p>}
|
<p className="picture_description">{imageDescription}</p>
|
||||||
|
)}
|
||||||
|
{imageCaption && (
|
||||||
|
<p className="picture_caption">{imageCaption}</p>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
@ -128,8 +132,12 @@ export default function Edit({ attributes, setAttributes, ...props }) {
|
||||||
imageUrl={imageUrl}
|
imageUrl={imageUrl}
|
||||||
imageProportion={imageProportion}
|
imageProportion={imageProportion}
|
||||||
/>
|
/>
|
||||||
{imageDescription && <p>{imageDescription}</p>}
|
{imageDescription && (
|
||||||
{imageCaption && <p>{imageCaption}</p>}
|
<p className="picture_description">{imageDescription}</p>
|
||||||
|
)}
|
||||||
|
{imageCaption && (
|
||||||
|
<p className="picture_caption">{imageCaption}</p>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="homegrade-blocks-text-image__column homegrade-blocks-text-image__column--text">
|
<div className="homegrade-blocks-text-image__column homegrade-blocks-text-image__column--text">
|
||||||
<InnerBlocks
|
<InnerBlocks
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,10 @@ export default function save({ attributes }) {
|
||||||
imageUrl={imageUrl}
|
imageUrl={imageUrl}
|
||||||
imageProportion={imageProportion}
|
imageProportion={imageProportion}
|
||||||
/>
|
/>
|
||||||
{imageDescription && <p>{imageDescription}</p>}
|
{imageDescription && (
|
||||||
{imageCaption && <p>{imageCaption}</p>}
|
<p className="picture_description">{imageDescription}</p>
|
||||||
|
)}
|
||||||
|
{imageCaption && <p className="picture_caption">{imageCaption}</p>}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
@ -41,8 +43,10 @@ export default function save({ attributes }) {
|
||||||
imageUrl={imageUrl}
|
imageUrl={imageUrl}
|
||||||
imageProportion={imageProportion}
|
imageProportion={imageProportion}
|
||||||
/>
|
/>
|
||||||
{imageDescription && <p>{imageDescription}</p>}
|
{imageDescription && (
|
||||||
{imageCaption && <p>{imageCaption}</p>}
|
<p className="picture_description">{imageDescription}</p>
|
||||||
|
)}
|
||||||
|
{imageCaption && <p className="picture_caption">{imageCaption}</p>}
|
||||||
</div>
|
</div>
|
||||||
<div className="homegrade-blocks-text-image__column homegrade-blocks-text-image__column--text">
|
<div className="homegrade-blocks-text-image__column homegrade-blocks-text-image__column--text">
|
||||||
<InnerBlocks.Content />
|
<InnerBlocks.Content />
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user