From 33665ae206452e29ad8a271b8c8eee43d33f0108 Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Mon, 6 Mar 2023 09:30:05 +1100 Subject: [PATCH] Custom Classname block support: Update code comments to remove reference to anchor id (#48709) --- packages/block-editor/src/hooks/custom-class-name.js | 8 ++++---- .../block-editor/src/hooks/custom-class-name.native.js | 7 +++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/block-editor/src/hooks/custom-class-name.js b/packages/block-editor/src/hooks/custom-class-name.js index b28ded7b9d0663..fa1a1cadc5712a 100644 --- a/packages/block-editor/src/hooks/custom-class-name.js +++ b/packages/block-editor/src/hooks/custom-class-name.js @@ -18,8 +18,7 @@ import { createHigherOrderComponent } from '@wordpress/compose'; import { InspectorControls } from '../components'; /** - * Filters registered block settings, extending attributes with anchor using ID - * of the first node. + * Filters registered block settings, extending attributes to include `className`. * * @param {Object} settings Original block settings. * @@ -42,6 +41,7 @@ export function addAttribute( settings ) { /** * Override the default edit UI to include a new block inspector control for * assigning the custom class name, if block supports custom class name. + * The control is displayed within the Advanced panel in the block inspector. * * @param {WPComponent} BlockEdit Original component. * @@ -89,8 +89,8 @@ export const withInspectorControl = createHigherOrderComponent( ); /** - * Override props assigned to save component to inject anchor ID, if block - * supports anchor. This is only applied if the block's save result is an + * Override props assigned to save component to inject the className, if block + * supports customClassName. This is only applied if the block's save result is an * element and not a markup string. * * @param {Object} extraProps Additional props applied to save element. diff --git a/packages/block-editor/src/hooks/custom-class-name.native.js b/packages/block-editor/src/hooks/custom-class-name.native.js index ea2d98068b7863..65ba2505053755 100644 --- a/packages/block-editor/src/hooks/custom-class-name.native.js +++ b/packages/block-editor/src/hooks/custom-class-name.native.js @@ -10,8 +10,7 @@ import { addFilter } from '@wordpress/hooks'; import { hasBlockSupport } from '@wordpress/blocks'; /** - * Filters registered block settings, extending attributes with anchor using ID - * of the first node. + * Filters registered block settings, extending attributes to include `className`. * * @param {Object} settings Original block settings. * @@ -32,8 +31,8 @@ export function addAttribute( settings ) { } /** - * Override props assigned to save component to inject anchor ID, if block - * supports anchor. This is only applied if the block's save result is an + * Override props assigned to save component to inject the className, if block + * supports customClassName. This is only applied if the block's save result is an * element and not a markup string. * * @param {Object} extraProps Additional props applied to save element.