Releases: ndiego/block-visibility
Releases · ndiego/block-visibility
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.
Version 2.5.0
Upgrade Notice
Block Visibility now requires WordPress 6.0+ with version 2.5.0 and users of the Pro add-on will need to upgrade to Pro 1.6.0 to take advantage of these latest enhancements. There have also been updates to the way visibility defaults work. Check out the release article for more information.
Added
- [Screen Size] Added filter for specifying blocks that are incompatible with the control.
- Added loading indicator in Editor visibility panel while settings and variables are being fetched.
- Added support for uncategorized block types in the Block Manager.
- Added back the ability to enable or disable help notices and popovers in the Editor.
- Added subtle upsell messaging in the plugin settings dashboard.
- Added Pro compatibility warning notice for versions 1.5.3 and lower.
Changed
- Block Visibility now requires WordPress 6.0 or greater.
- [User Role] Fetch users directly rather than rely on the Block Visibility variables endpoint.
- Redesigned the Editor UI to match the WordPress 6.1 design system.
- Redesigned the Block Manager.
- Consolidated all external plugin links into a single directory.
- Optimized all custom SVG icons, including those used in contextual indicators. Indicator stylesheet is now 50% smaller.
Removed
- Removed visibility panel and toolbar controls on Custom HTML blocks in the block-based Widget Area due to incompatibility. Visibility controls are still available for the Custom HTML block in the post/page Editor as well as the Site Editor.
- Removed unnecessary custom icons.
- Removed support url from variables endpoint.
Fixed
- [Advanced Custom Fields] Fixed bug where numeric ACF fields were not being evaluated correctly. (#50)
- [Screen Size] Fixed bug where using the Screen Size control and the
meow-gallery/gallery
block. Added better error handling to avoid a similar issue in other third-party blocks. - Fixed bug where resetting settings on a specific tab would reset all plugin settings.