Skip to content

Releases: ndiego/block-visibility

Version 3.1.0

21 Sep 11:26
Compare
Choose a tag to compare

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

14 Jul 12:13
ae00ad6
Compare
Choose a tag to compare

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

04 Jun 16:47
Compare
Choose a tag to compare

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

16 Apr 14:56
Compare
Choose a tag to compare

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

25 Mar 22:27
Compare
Choose a tag to compare

Fixed

  • Fixed bug that caused translations to stop working in the Editor after the 3.0.0 release. (#68)

Version 3.0.0

23 Mar 13:29
Compare
Choose a tag to compare

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- and ControlSetControlsIntegrations- slots for adding visibility control editor UI elements.
  • Added the PluginSettings slot for adding additional plugin settings.
  • Added the VisibilityControls, VisibilityControlsGeneral, and VisibilityControlsIntegrations slots for adding additional visibility control settings.
  • Added the blockVisibility.globallyRestrictedBlockTypes and blockVisibility.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, use ControlSetControlsIntegrations- instead.
  • Deprecated the VisibilityControlsIntegrationsBottom slot, use VisibilityControlsIntegrations 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 and blockVisibility.addControlSetOptions filters.
  • Removed the ControlSetControlsTop- and ControlSetControlsMiddle- slots.
  • Removed the PluginSettingsEditorTop and PluginSettingsEditorTop slots.
  • Removed the PluginSettingsTop, PluginSettingsMiddle, and PluginSettingsBottom slots.
  • Removed the VisibilityControlsTop, VisibilityControlsMiddle, and VisibilityControlsBottom slots.
  • Removed the VisibilityControlsIntegrationsTop and VisibilityControlsIntegrationsBottom slots.
  • Removed the RuleSetOptionsTop, RuleSetOptionsMiddle, RuleSetOptionsBottom, and RuleSetMoreSettingsTools slots.
  • [Date & Time] Removed the block_visibility_frontend_test_date_time_schedule filter.
  • [Date & Time] Removed the VisibilityControlsDateTimeTop and VisibilityControlsDateTimeBottom slots.
  • [Date & Time] Removed the DateTimeScheduleToolbar- and DateTimeScheduleControlsTop-, and DateTimeScheduleControlsBottom- slots.
  • [Date & Time] Removed the ScheduleOptionsTools, ScheduleOptionsMiddle, and ScheduleOptionsBottom slots.
  • [Screen Size] Removed the ScreenSizeControls slot.
  • [User Role] Removed the VisibilityByRoleControls slot.

Version 2.6.0

13 Feb 12:21
Compare
Choose a tag to compare

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

06 Feb 02:52
Compare
Choose a tag to compare

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

25 Jan 03:16
Compare
Choose a tag to compare

Fixed

  • Fixed bug in contextual indicators that would override custom block classes added by third-party plugins. (#61)

Version 2.5.1

03 Jan 23:03
2307f9a
Compare
Choose a tag to compare

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.