Block Visibility Versions Save

Conditional visibility controls for all WordPress blocks.

v3.4.0

1 month 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.

v3.3.0

3 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.

v3.2.0

4 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.

v3.1.2

7 months 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.

v3.1.1

7 months 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.

v3.1.0

7 months 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).

v3.0.4

10 months 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.

v3.0.3

11 months 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.

v3.0.2

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.

v3.0.1

1 year ago

Fixed

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