Releases: ndiego/block-visibility
Releases · ndiego/block-visibility
Version 3.1.0
Added
- [WooCommerce] Added the WooCommerce control. (#83)
- [Easy Digital Downloads] Added the Easy Digital Downloads control. (#87)
- Added a Command Palette command for "Manage Visibility Presets". Requires WordPress 6.3+ or the latest version of Gutenberg. (#84)
- Added a Block Visibility Pro deprecation notice when Pro is installed and active.
Changed
- Increased the minimum WordPress version to 6.2 and the minimum version of PHP to 7.0.
- Moved all Block Visibility Pro features to the base plugin.
- Refactored away from
getEntityRecord
(#77). - [Metadata] Improved support for metadata in array or object format. (#86)
Fixed
- Fixed typo on
hide_on_restricted_users
variable (#64).
Version 3.0.4
Fixed
- [Location] Fixed bug that prevented the Relative Hierarchy rule from working. The value field was set to multi-select when it should be a single selection.
Version 3.0.3
Changed
- Updated the
blockVisibility.contextualIndicatorClasses
filter to include more variables, which allows for more customization. Example usage below:
/**
* Modifies the indicator classes based on active controls. In this
* case, add a class if the block has been hidden on medium screens.
*
* @param {string} classes - The original classes of the indicator.
* @param {Array} activeControls - The active controls.
* @param {object} controls - The controls object.
*
* @returns {string} - The modified classes of the indicator.
*/
function modifyIndicatorClasses( classes, activeControls, controls ) {
if ( activeControls.includes( 'screen-size' ) ) {
const screenSize = controls?.screenSize;
const hiddenOnMedium = screenSize?.hideOnScreenSize?.medium ?? false;
if ( hiddenOnMedium ) {
return classes + ' hidden-on-medium';
}
}
return classes;
}
wp.hooks.addFilter(
'blockVisibility.contextualIndicatorClasses',
'example-plugin/modify-indicator-classes',
modifyIndicatorClasses
);
Fixed
- [Query String] Fixed bug when using 0 as the value of a query parameter would cause unexpected results.
Version 3.0.2
Removed
- Removed visibility control defaults so the Visibility panel starts empty. This simplifies the interface and reduces confusion around Visibility Presets for users that have no need for this functionality.
Fixed
- Fixed bug that caused an error when Visibility Presets were enabled on a block, but no actual presets existed.
- Fixed missing text domain in string.
Version 3.0.1
Fixed
- Fixed bug that caused translations to stop working in the Editor after the 3.0.0 release. (#68)
Version 3.0.0
Read the Block Visibility 3.0.0 announcement post.
Added
- Added the Browser & Device control.
- Added the Cookie control.
- Added the Location control.
- Added the Metadata control.
- Added the Referral Source control.
- Added the URL Path control.
- Added the Visibility Preset control.
- Added Day of Week and Time of Day functionality to the Date & Time control.
- Added control set utility support.
- Added local visibility control support.
- Added the
ControlSetControls-
andControlSetControlsIntegrations-
slots for adding visibility control editor UI elements. - Added the
PluginSettings
slot for adding additional plugin settings. - Added the
VisibilityControls
,VisibilityControlsGeneral
, andVisibilityControlsIntegrations
slots for adding additional visibility control settings. - Added the
blockVisibility.globallyRestrictedBlockTypes
andblockVisibility.widgetAreaRestrictedBlockTypes
filters to restrict visibility controls on specific block types.
Changed
- Plugin scripts are now enqueued with
enqueue_block_editor_assets
, and previous workarounds have been removed. - Deprecated the
ControlSetControlsBottom-
slot, useControlSetControlsIntegrations-
instead. - Deprecated the
VisibilityControlsIntegrationsBottom
slot, useVisibilityControlsIntegrations
instead.
Removed
- Removed Pro upgrade link on the plugins admin page.
- Removed Pro upsells from settings pages.
- Removed block-level contextual indicator filters.
- Removed the
blockVisibility.addControlSetModals
andblockVisibility.addControlSetOptions
filters. - Removed the
ControlSetControlsTop-
andControlSetControlsMiddle-
slots. - Removed the
PluginSettingsEditorTop
andPluginSettingsEditorTop
slots. - Removed the
PluginSettingsTop
,PluginSettingsMiddle
, andPluginSettingsBottom
slots. - Removed the
VisibilityControlsTop
,VisibilityControlsMiddle
, andVisibilityControlsBottom
slots. - Removed the
VisibilityControlsIntegrationsTop
andVisibilityControlsIntegrationsBottom
slots. - Removed the
RuleSetOptionsTop
,RuleSetOptionsMiddle
,RuleSetOptionsBottom
, andRuleSetMoreSettingsTools
slots. - [Date & Time] Removed the
block_visibility_frontend_test_date_time_schedule
filter. - [Date & Time] Removed the
VisibilityControlsDateTimeTop
andVisibilityControlsDateTimeBottom
slots. - [Date & Time] Removed the
DateTimeScheduleToolbar-
andDateTimeScheduleControlsTop-
, andDateTimeScheduleControlsBottom-
slots. - [Date & Time] Removed the
ScheduleOptionsTools
,ScheduleOptionsMiddle
, andScheduleOptionsBottom
slots. - [Screen Size] Removed the
ScreenSizeControls
slot. - [User Role] Removed the
VisibilityByRoleControls
slot.
Version 2.6.0
Added
- [ACF] Added support for "greater than", "greater than or equal", "less than", and "less than or equal" operators for numeric and date/time fields.
- [ACF] Added field type help message.
Changed
- [ACF] Improved support for numeric and date/time fields.
- [ACF] Improved support for "choice" fields.
- Improved help message support in rule set fields.
Removed
- [ACF] Removed frontend tests that were deprecated in v1.9.0.
Fixed
- [ACF] Fix information popover position.
- Fixed translations not working on the plugin settings page. Thanks @webaxones for discovering this issue and also for translating the plugin into French!
- Fixed incorrect JSDoc tags throughout the plugin.
Version 2.5.4
Changed
- Improved Kadence Blocks support by only displaying the Visibility panel on the Advanced tab. (Requires Kadence Block 3.0+)
- Explicitly set the InspectorControls group to "settings" for the new tabbed interface in WordPress 6.2.
Fixed
- Fixed bug in contextual indicators that would incorrectly add visibility classes to blocks.
Version 2.5.3
Fixed
- Fixed bug in contextual indicators that would override custom block classes added by third-party plugins. (#61)
Version 2.5.1
Changed
- Consolidated controls filters into a single filter.
- Renamed and consolidated contextual indicator filters.
Fixed
- Fixed conditional opacity CSS for text-only blocks. (#54)
- Fixed data fetching method to only return simplified variables in plugin settings.
- Fixed incorrect translation strings.
- Fixed styling on control reset button to match Core tools panels.