Skip to content

Commit

Permalink
Merge pull request #911 from publishpress/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
htmgarcia authored Mar 30, 2022
2 parents b83c396 + 809731c commit 9addd1c
Show file tree
Hide file tree
Showing 28 changed files with 21,167 additions and 11,716 deletions.
6 changes: 3 additions & 3 deletions src/advanced-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Plugin Name: PublishPress Blocks
* Plugin URI: https://publishpress.com/blocks/
* Description: PublishPress Blocks has everything you need to build professional websites with the Gutenberg editor.
* Version: 2.11.6
* Tested up to: 5.9.1
* Version: 2.12.0
* Tested up to: 5.9.2
* Author: PublishPress
* Author URI: https://publishpress.com/
* License: GPL2
Expand Down Expand Up @@ -39,7 +39,7 @@
defined('ABSPATH') || die;

if (! defined('ADVANCED_GUTENBERG_VERSION')) {
define('ADVANCED_GUTENBERG_VERSION', '2.11.6');
define('ADVANCED_GUTENBERG_VERSION', '2.12.0');
}

if (! defined('ADVANCED_GUTENBERG_PLUGIN')) {
Expand Down
2 changes: 1 addition & 1 deletion src/assets/blocks/advbutton/block.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ import {IconListPopupHook} from "../0-adv-components/icon-class.jsx";
</PanelBody>
{advgbBlocks.advgb_pro === '1' && (
<Fragment>
<PanelBody title={ __( 'Icon', 'advanced-gutenberg' ) } initialOpen={ false } >
<PanelBody title={ __( 'Icon', 'advanced-gutenberg' ) } initialOpen={ false } className="advgb-pro-icon">
<ToggleControl
label={ __( 'Display icon', 'advanced-gutenberg' ) }
checked={ iconDisplay }
Expand Down
42 changes: 33 additions & 9 deletions src/assets/blocks/advimage/block.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@
const { blockIDX } = attributes;

setAttributes({blockIDX: `advgb-img-${clientId}`});

// Reset attributes when Pro is not available
if( advgbBlocks.advgb_pro !== 'undefined' && advgbBlocks.advgb_pro !== '1' ) {
setAttributes( {
titleTag: 'h4',
subtitleTag: 'p'
} );
}
}

render() {
Expand All @@ -50,7 +58,7 @@
blockIDX, openOnClick, openUrl, linkInNewTab, imageUrl, imageID,
title, titleColor, subtitle, subtitleColor, overlayColor, defaultOpacity,
fullWidth, width, height, vAlign, hAlign, overlayOpacity, focalPoint,
isPreview,
isPreview, titleTag, subtitleTag
} = attributes;
const blockClassName = [
'advgb-image-block',
Expand Down Expand Up @@ -236,7 +244,7 @@
/>
}
<RichText
tagName="h4"
tagName={ titleTag }
className="advgb-image-title"
value={ title }
onChange={ (value) => setAttributes( { title: value.trim() } ) }
Expand All @@ -248,7 +256,7 @@
allowedFormats={ [] }
/>
<RichText
tagName="p"
tagName={ subtitleTag }
className="advgb-image-subtitle"
value={ subtitle }
onChange={ (value) => setAttributes( { subtitle: value.trim() } ) }
Expand Down Expand Up @@ -354,6 +362,14 @@
isPreview: {
type: 'boolean',
default: false,
},
titleTag: {
type: 'string',
default: 'h4'
},
subtitleTag: {
type: 'string',
default: 'p'
}
};

Expand Down Expand Up @@ -395,6 +411,8 @@
vAlign,
hAlign,
focalPoint,
titleTag,
subtitleTag
} = attributes;
const linkURL = ( openOnClick === 'url' && !!openUrl ) ? openUrl : undefined;
const blockClassName = [
Expand Down Expand Up @@ -423,14 +441,20 @@
href={ linkURL }
/>
{title && (
<h4 className="advgb-image-title" style={ { color: titleColor } }>
{title}
</h4>
<RichText.Content
tagName={ titleTag }
className="advgb-image-title"
style={ { color: titleColor } }
value={ title }
/>
) }
{subtitle && (
<p className="advgb-image-subtitle" style={ { color: subtitleColor } }>
{subtitle}
</p>
<RichText.Content
tagName={ subtitleTag }
className="advgb-image-subtitle"
style={ { color: subtitleColor } }
value={ subtitle }
/>
) }
</div>
);
Expand Down
Loading

0 comments on commit 9addd1c

Please sign in to comment.