22 Feb 2024

feedWordPress Planet

BuddyPress: BuddyPress 12.3.0 maintenance release

Immediately available is BuddyPress 12.3.0. This maintenance release fixes 7 bugs. The most serious one was happening when a community member requested an email address change from her/his front-end profile: the link to verify the request validity was not generated the right way. This bug is only concerning versions 12.0.0 to 12.2.0. It was reported 12 hours ago and we decided to quickly build this maintenance release to fix it as soon as possible.

For details on all changes, please read the 12.3.0 release notes.

Update to BuddyPress 12.3.0 today in your WordPress Dashboard, or by downloading it from the WordPress.org plugin repository.

Many thanks to 12.3.0 contributors

yagniksangani, johnjamesjacoby, r-a-y, vapvarun, testovac, emaralive & imath.

22 Feb 2024 10:13pm GMT

Gutenberg Times: Block Bindings and Custom Fields – an (almost) no-code example

With the upcoming release of version 6.5, WordPress will receive the first iteration of Block Bindings API, a way to bind content of blocks to data stored in custom fields. Custom fields have been around for a long time. What wasn't available was a way for content creators / no-code site builders to read out the values of custom fields without using plugins like ACF or Metabox, etc. To include values from Custom fields on Theme templates, you also need a developer to help out.

This first iteration is mostly for developers. Justin Tadlock published Introducing Block Bindings, part 1: connecting custom fields.

So you might ask why should I bother? And you'd be right. Whether you are a no-code site builder or site owner, don't quit just yet.

As Custom Fields have been part of WordPress since the Stone Age, there is a way to add and modify custom fields. The good ol' meta boxes.

Block Bindings will open so many possibilities that many users have been longing for since the start of blocks in 2017. I found the feature so intriguing that I wondered if I could make it work now using as little code as possible. And with a minimal squinting in the code editor, you can start using it, too. Even if only as a proof of concept. There is the little warning: Use this in production at your own risk.

Here is a rundown of my idea:

Each blog post is part of a logbook, which reports what happened today- including a note about the weather, which then appears above the title of a post.

Here are the broad steps to accomplish this:

The middle step is the meat of the matter, and that's where the squinting skill comes in. If you know how to use meta boxes to create custom fields, you can skip over the next section right to the middle step.

How to use Meta boxes to create a Custom Field

First, you need to enable Custom Fields for the post editor via the Preference menu . Go to the 3-dot Options menu and select Preferences. But before you go there, make sure you saved all your changes to the post. To show the meta boxes below the post, the block editor needs to reload the page, and unsaved content would be removed.

Here is a short video.

You can add a new custom field called "Weather" to the post and add the value: "Sunny with a chance of rain in the afternoon."

For subsequent posts you can select the name of the Custom field from the dropdown box and add the value.

That was our short discourse on handling Custom Fields with WordPress. Now we apply your knowledge a bit further.

Block Binding Block markup

The documentation for the Block Bindings shows how you can use the block markup to add information about the meta field (aka Custom field) to the block.

The template looks like this:

<!-- wp:paragraph {
      } -->
<!-- /wp:paragraph -->

The source parameter identifies the place where the system looks for the information. Here it says, "core/post-meta." That's the space where custom fields and their values are stored. In the args section, it asks for the key of the custom field, that's the name, which is "Weather" in our case.

Yes, it can be a bit intimidating. You need to enter the code editor for a minute to add this to your post.

Now, here comes the hard part for non-coders.

Here is a video of the whole process.

Phew! For the first time, that seems like a complicated move. You might not want to do too often, right? Or maybe it gives you a bit more confidence. I'd be happy to help you while you try to figure it out. Just email me at pauli@gutenbergtimes.com or ping me in WP Slack as @bph.

Add the block with bindings to the single post template

The next and final step is easier. Now that you know how this works, you might want to add the block to the Single Post template. So every time an editor makes a logbook entry and adds the weather to the meta box, it will display on the front end.

Here is the video of the steps.

From there, you can embellish the weather section of your posts some more.

After I transformed the block into a column, I added another paragraph to the template section with a drop shadow.

Some things to consider

Although it works well when you always remember to add the weather note to every post, there is no reminder, and we know there is no preview. I also see two major issues:

In his post, Introducing Block Bindings, part 1: connecting custom fields, Justin Tadlock wrote about how to user register_meta() function to add custom fields properly.

Meta boxes are also a legacy system that doesn't really fit the block editor way of doing things anymore. The Gutenberg developers are working on the interface to add and edit custom fields as well as make the block show that it's connected to a custom field.

If you are interested in the Block Binding API work you can follow along this tracking issue.

Please share in the comments if you run into trouble, and you are welcome to share your ideas and implementations if you followed along. Furthermore, please post your questions so we can answer them.

On the WordPress Slack space there is also an #outreach channel where I and other contributors hang out to answer questions and facilitate discussions about upcoming features. You are more than welcome to join. If you are not on the WordPress Slack yet, you can sign up with your WordPress.org account and then follow the instructions.

22 Feb 2024 6:31pm GMT

WPTavern: WooCommerce Releases 8.6 & 8.6.1


WooCommerce 8.6, delayed due to an Order Attribution Tracking issue, has been released. It features a new Product Details block style, six new layouts for the Product Collection block, and a sales column for marketing analytics.

For developers, it offers improved logging, a notice on Legacy REST API removal, simplified customer history calculation, and 8.6.1 patching four issues.

After a slight delay, WooCommerce 8.6 was released last week. An Order Attribution Tracking issue discovered in 8.5.2 prompted the delay so that a fix could be included in the 8.6 release. With 365 commits from 73 contributors, this latest version of WooCommerce introduces some slick new features and enhancements for merchants and developers.

Key Features

Product Details Block Styles Section

New Block Style for Product Details Block

WooCommerce 8.6 introduces a new 'Styles' area for the Product Details block with two options; Classic and Minimal. By default the Minimal style is selected on new installs with the Classic style being maintained to ensure compatibility with theme-based CSS customizations.

Product Collection Block Gains Six New Layouts

Probably the most impactful feature for merchants and marketers is the introduction of six new layouts for the Product Collection block. Now merchants can select between New Arrivals, Top Rated, Best Selling, On Sale, Featured and Product Catalog.

Screenshot of Product Collection Layouts Interface.

These new layouts can be combined, mixed and matched on a single page to respond better to the needs of merchants. For example, promote your new spring arrivals in a block above your winter sale items that leads into your complete product catalog.

Sales Column Added to Marketing Page

For merchants who are using WooCommerce to view and manage their marketing channels (i.e. Google Ad campaigns), a new column in the Sales card provides a quick look at how various campaigns are performing.

Developer Updates

Logging System Changes

Significant improvements have been made to the internal logging system in WooCommerce 8.6. Merchants and developers now have an interface for browsing and viewing log entries that will improve debugging and auditing in the future.

There is now a log file browser that lets users filter, sort and manage log files. Users can now click individual log files and view them right within their WordPress dashboard. Search has also been improved to enable selecting a group of files to search within, filtering, sorting and linking individual lines in files that contain the search term. Logs have also now been made fully exportable. Users can download individual files or in bulk via a zip file.

Legacy REST API Removal Notice

As WooCommerce prepares for the removal of its legacy REST API in 9.0, merchants still using the legacy API will now see a notice of the upcoming change. Given the pace of releases, this means deprecation/removal is about 4 months away.

Simplified Customer History Calculation

With Order Attribution Tracking the main cause for the delay in releasing 8.6, a simplified customer history calculation was introduced to mitigate the risk of a calculation resulting in 500 errors (server errors) on larger shops.

8.6.1 Release Patches 4 Issues

A patch was released earlier this week that fixes four issues identified with the release of 8.6. These issues were significant enough that this release was issued very quickly. Check out the details on the WooCommerce Developer blog.

w00t Dev Docs

By Ronny Shani

Shortly before the release, the team launched a brand new documentation website for developers. The Woo Developer Docs embraces the docs-as-code approach, hosting markdown files in a centralized location: the docs folder of the project's GitHub monorepo.

This approach is a win-win:

  1. It encourages community collaboration and empowers users to contribute to the documentation.
  2. It enables the plugin's developers to update docs whenever they modify or update WooCommerce's codebase.

Improving the developer experience is part of Woo's roadmap; V1 is a great example of how to do it right.

Progress On New Product Editor

Finally, a small tweak to the new Product Editor was introduced, adding the ability to mark a product as Featured. Merchants using the new Product Editor can click an inline star icon in the title field. The new product editor is making steady progress as it reshapes the way merchants interact with WooCommerce in the product creation flow.

If you have not yet, now is a good time to give the new Product Editor a test drive to see what's coming and how the interface of WooCommerce is changing.

22 Feb 2024 6:10pm GMT