[ad_1] It has been several months since I last dived into Nick Diego’s Block Visibility plugin, and it is now one year since the initial release. Recently moved on from his past job into the WordPress product space, he has been building one of the best context-based plugins for showing or hiding content. In January, Diego touted some of the ideas he had for a yet-to-be-released Block Visibility Pro. He was already fulfilling user needs, but there was so much left to be explored. “As Block Visibility grows, there will be advanced and/or niche functionality that will be useful for certain users,” he said at the time. “Think integrations with other third-party plugins. There will always be a free version of the plugin but some of these additional features will ultimately be provided by a premium (paid) add-on called Block Visibility Pro.” Diego quietly released the pro add-on in June, which does not take away from the free version. Everything in it is a pure value-add and helps specific sets of users. Last week, he released Block Visibility Pro 1.1.0, and I managed to get a test copy to play around with. In short, I am more impressed than I was when I first covered the free version in January. Pro Additions Early versions of the free plugin had visibility controls for all visitors, user roles, and start-and-stop dates. Since then, Diego has beefed up the options to include screen size, logged-in status, and user accounts. It also integrates with Advanced Custom Fields and WP Fusion. That is more than many other content-visibility solutions will offer before needing to upgrade to a commercial or pro version. The current pro version includes conditional controls for the following: Location (Query and Post) Time-based and day of week WooCommerce Easy Digital Downloads Browser and Device URL Path Referral Source The Location controls are what I have found myself tinkering with the most. They are handy at the moment but will offer more power when used in conjunction with WordPress’s upcoming site editor. Location, query-based visibility controls. The Location controls are essentially query-based visibility options. Users can choose to show or hide blocks based on post type, taxonomy, and more. Everything from individual post attributes to the archive type is available. Users can also create multiple rule sets, combining various location-based options. For shop owners, the WooCommerce and Easy Digital Downloads integrations are extensive. Users can display blocks based on shopping cart content, customer metrics, and product metrics. This could come in handy for promotions, coupons, and similar features. One of my favorite features, which is also included in the free version, is a popup option for selecting which visibility settings should appear in the sidebar. Toggling visibility controls in the Visibility tab. This feature reduces the footprint of the plugin’s Visibility tab in the block sidebar panel while giving users control over which options they would like to use. It looks similar to a current proposal for the Gutenberg plugin that would allow users to toggle specific controls: Proposal for toggling block typography controls. The differences between the two are in the location of the “ellipsis” button to open the popup. The Gutenberg proposal has it at the top of the tab. Block Visibility adds it as a control within its Visibility tab. However, the concept is the same, and the plugin provides a real-world test of how the feature could work. Thus far, I am happy with the result. It allows me to hide options that I would rarely use. I am eager for something similar to eventually work its way into core WordPress. From Developer to Developer If I am being honest, I am a bit envious of the work Diego has done. Many do not know this, but I also built a similar solution to Block Visibility in 2019. It was before I joined the staff here at WP Tavern. Before seeing that project mature, I handed it over as part of a larger IP sale. I point this out because I understand the complexities of building a solution that works from a technical standpoint while also being user-friendly. It is not easy, but Block Visibility seems to hit the right balance. And I do not say this often, but Diego’s work far exceeds anything I had built or even had in the pipeline. It is on another level, so a part of me is glad that he and I are not competing in this space. At the same time, I wish I could go back and implement some of these ideas on my former project. Like this: Like Loading… [ad_2] Source link
Continue readingTag Archives: Controls
Gutenberg 10.8 Adds New Typography Controls and Block Previews – WordPress Tavern
[ad_1] On Wednesday, Gutenberg 10.8 landed in the WordPress plugin directory. The release includes new typography options for controlling the Heading block’s font-weight and the List block’s font family. The Audio and File blocks now show preview content in the inserter. Gutenberg 10.7 felt like it introduced flashier features than 10.8. But, this was still a solid release. Sometimes the things that you do not see are just as important as those that you do. Full Site Editing (FSE) components continue to move along at a swift pace. Most changes were bug fixes rather than enhancements. One of the primary theme-related FSE upgrades allows developers to set the padding for nav menu links via theme.json. This may be a small win, but it is unlikely to address the numerous issues with styling navigation items and nested lists. The change also does not affect the Page List block links, which can be set as a nav menu item. The Navigation block will be one of the toughest nuts to crack before site editing is a possibility. Enhancements like this help, but it is a long and winding road to a solution that satisfies both theme authors and users. Users should see the post title in template-editing mode. The template details modal also includes more detailed information, such as how to best name custom templates. New Typography Options Gutenberg 10.8 enables the font-weight control for Heading blocks. This allows theme authors to define the default weight via their theme.json files, and users can override this via the sidebar panel in the editor. Testing font weights for the Heading block. The control displays all nine possible weights: Thin Extra Light Light Regular Medium Semi Bold Bold Extra Bold Black While each weight is selectable, it does not mean all fonts support a specific weight. For example, users will see no difference between Extra Bold and Black with the Twenty Twenty-One theme. In the long term, this should be coupled with the font family control. This would allow theme authors to define which weights are supported by a specific family, making those the only options for users. The List block is jumping ahead of others with its support of the font family option. Generally, we would see the Heading or Paragraph blocks gain such features first. Setting a custom font family for a List block. The Site Title, Site Tagline, and Post Title blocks all currently support the font family control. It is a welcome addition to see expanded typography options, but I look forward to the day they are offered across every block. Theme authors can also define custom letter spacing for the Site Title and Site Tagline blocks. However, the feature does not currently appear in the block options sidebar, which would allow users to customize it. There is an open ticket to address this missing piece of the UI. Audio and File Block Previews Audio block preview in the inserter. The development team added new previews for the Audio and File blocks in the inserter. This is a nice-to-have enhancement, adding long-missing previews of some of the remaining core blocks, but it is also a bug fix. In previous versions of the block editor, users who attempted to upload media via the Audio or File blocks would get a duplicate upload. This only happened in situations where their theme or a plugin registered a custom block style. Adding a preview apparently fixed this odd bug. This change also nearly gives us a complete set of previews for the pre-WordPress 5.8 blocks. Classic, Spacer, Shortcode, and Legacy Widget do not have them, but they are unique cases. The upcoming theme-related blocks also lack previews. “Archives” Label Now Shown for Archives Dropdown Duplicate archives heading and label. When using the Archives block as a dropdown, it now outputs a label titled “Archives.” While it is a seemingly trivial change, it could impact how themes typically present this block. This enhancement changes some existing expectations. The primary use case throughout WordPress’s history has been to show the Archives dropdown in a widget. In that case, there is almost always a widget title with the “Archives” text preceding it. I expect most other use cases would follow a similar pattern. This essentially creates duplicate text. Themes Team representative Carolina Nymark had an alternate suggestion: What if the label was visible by default, but there was an option for hiding it? Similar to the search block, except there would be an actual label hidden with a screen reader text CSS class when the option is toggled. That would have been my suggestion too if I had seen the ticket earlier. For now, theme authors who need to hide it should target the .wp-block-archives-dropdown > label class in their CSS. Like this: Like Loading… [ad_2] Source link
Continue reading