block-visibility

Conditional visibility controls for all WordPress blocks.

GPL-2.0 License

Stars
118

Bot releases are hidden (Show)

block-visibility - Version 3.6.1 Latest Release

Published by ndiego about 1 month ago

Fixed

  • [ACF] Fixed bug where ACF fields were not being displayed following the v3.6.0 update.
block-visibility - Version 3.6.0

Published by ndiego about 1 month ago

Added

  • [Location] Added ability to show/hide blocks in archive templates based on taxonomy attributes (Hierarchy, Relative Hierarchy, and Supports).
  • [Location] Added ability to show/hide blocks if the current post has an excerpt.

Changed

  • Front-end classes are now implemented using the HTML API.
  • Updated the render_block callback function to only fetch plugin settings if a block has visibility conditions set.
  • Updated deprecated Button component variant and size properties.
  • Updated popover placement and offsets.
  • Updated general component styling to match Core.
  • Updated React Select component to match Select controls in Core.
  • Refactored the main plugin class.
  • Refactored the setting tabs.
  • Refactored the link utility and updated all plugin links.
  • Removed control filters deprecated in v2.5.1.
  • Removed all usage of get_file_data().

Fixed

  • Fixed backward compatibility error due to the unified extensibility APIs in WordPress 6.6.
  • Fixed Widget Editor notice in WordPress 6.6+.
  • Fixed spacing in the Day of Week control.
  • Fixed Firefox content overflow issue with the React Select component.
block-visibility - Version 3.5.0

Published by ndiego 3 months ago

Changed

  • Update "Tested up to" to WordPress 6.6.
  • Update "Requires at least" to WordPress 6.4.
  • Update the PluginMoreMenuItem slot usage to support unified slots in 6.6 and ensure backward compatibility.

Fixed

  • [Date & Time] Fix style bug in the day-of-week controls.
  • Fix the useCommand import now that 6.4 is the minimum version.
block-visibility - Version 3.4.0

Published by ndiego 7 months ago

Added

  • [Date & Time] Add the ability to set seasonal (year-agnostic) schedules.

Changed

  • Update Playground blueprint with improved demo content.
  • Update "Tested up to" to WordPress 6.5.
  • Update "Requires at least" to WordPress 6.3.
  • To use conditional opacity, you now must also have conditional indicators active.
  • Set rewrites to false for the visibility_preset post type.
  • Update the deprecated __experimentalGetSettings function with the stable __getSettings version.
  • [WooCommerce] When retrieving orders, both processing and completed orders are now included.

Fixed

  • Fix enqueue styles console errors by enqueuing the conditional indicator stylesheet using enqueue_block_assets.
block-visibility - Version 3.3.0

Published by ndiego 9 months ago

Added

  • [ACF] Added the ability to conditionally display blocks based on fields in options pages.
  • Added support for help descriptions and labels in rule fields.

Changed

  • [Screen Size] Breakpoint defaults are now displayed as placeholders in the plugin settings.
  • Improve the placement of dropdown menus in the Visibility panel to match Core.

Removed

  • [ACF] Removed deprecated rule handling that was introduced in v1.8.0 (2021)

Fixed

  • [ACF] Fixed the broken rule set UI when cleared.
  • [Screen Size] Fixed fatal error caused by deleting a breakpoint and saving an empty value.
block-visibility - Version 3.2.0

Published by ndiego 10 months ago

Added

  • [Location] Added ability to show/hide a block if the current user is the author of the current post or page.

Changed

  • Bumped the "Tested up to" version to WordPress 6.4.
block-visibility - Version 3.1.2

Published by ndiego about 1 year ago

Fixed

  • Fixed issue where the Visibility panel would display when data fetching was still in process, causing other errors.
  • Fixed issue where the Visibility panel would not display if the User Permissions setting was enabled and the user was an Admin.
  • Fixed incorrect error handling when data cannot be fetched.
block-visibility - Version 3.1.1

Published by ndiego about 1 year ago

This release is exactly the same as version 3.1.0, but was required to stay in line with the WordPress.org repo. Two folders were missing when the plugin was synced to the plugin repo. To fix the issue, the version had to be bumped to 3.1.1.

Fixed

  • Fixed missing folders when the plugin was synced to WordPress.org.
block-visibility - Version 3.1.0

Published by ndiego about 1 year ago

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).
block-visibility - Version 3.0.4

Published by ndiego over 1 year ago

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.
block-visibility - Version 3.0.3

Published by ndiego over 1 year ago

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.
block-visibility - Version 3.0.2

Published by ndiego over 1 year ago

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.
block-visibility - Version 3.0.1

Published by ndiego over 1 year ago

Fixed

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

Published by ndiego over 1 year ago

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.
block-visibility - Version 2.6.0

Published by ndiego over 1 year ago

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.
block-visibility - Version 2.5.4

Published by ndiego over 1 year ago

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.
block-visibility - Version 2.5.3

Published by ndiego over 1 year ago

Fixed

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

Published by ndiego almost 2 years ago

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.
block-visibility - Version 2.5.0

Published by ndiego almost 2 years ago

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.
block-visibility - Version 2.4.6

Published by ndiego almost 2 years ago

Fixed

  • Fixed bug where contextual indicator styles caused issues with Cover blocks when a custom indicator color was chosen in WordPress 6.1.
  • Fixed bug where contextual indicator styles caused issues with hover states in the Site Editor when a custom indicator color was chosen in WordPress 6.1.