Docs: Add styles property to block-api.md#11080
Merged
Conversation
gziolo
reviewed
Oct 26, 2018
docs/block-api.md
Outdated
| ], | ||
| ``` | ||
|
|
||
| Plugins and Themes can also register [custom block style](../docs/extensibility/extending-blocks/#modifying-blocks) for exisiting blocks. |
Member
There was a problem hiding this comment.
I think it should be ../docs/extensibility/extending-blocks.md#block-style-variations
gziolo
approved these changes
Oct 26, 2018
Member
gziolo
left a comment
There was a problem hiding this comment.
Feel free to merge when you update the link. Otherwise looks good 👍
gziolo
reviewed
Oct 26, 2018
gziolo
previously requested changes
Oct 26, 2018
Member
gziolo
left a comment
There was a problem hiding this comment.
Two minor issues, let's fix an iterate. I was too quick :)
Member
Author
|
@gziolo fixed 👍 |
Member
|
The indentation is still off. All but the first line in the code snippet are tabbed one too far. |
Member
Author
|
@aduth looks like got the intention right my code and github markdown preview are poles apart 😅 |
aduth
approved these changes
Oct 26, 2018
Co-Authored-By: ajitbohra <ajit@lubus.in>
gziolo
added a commit
that referenced
this pull request
Mar 3, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
gziolo
added a commit
that referenced
this pull request
Mar 3, 2026
…#76014) * Connectors: Dynamically register providers from WP AI Client registry Polyfills WordPress/wordpress-develop#11080 for the Gutenberg plugin: - Expand `_gutenberg_get_provider_settings()` to dynamically fetch registered providers from the AI Client registry, in addition to the three hardcoded featured providers (Gemini, OpenAI, Claude). - Restructure the return value to be keyed by provider ID with `name`, `description`, `credentials_url` at the top level and `settings` as a nested array. - Filter out providers whose authentication method is not `api_key`. - Update all consumer functions to use the new structure. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Expose provider settings to the script module Pass provider data (name, description, credentials URL, setting keys) to the `connectors-wp-admin` script module via the `script_module_data` filter, making it available as inline JSON for the frontend to consume. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Register connectors dynamically from server-provided data Replace hardcoded per-provider connector components with a single dynamic loop that reads provider data from the script module data JSON tag. Known providers retain their SVG logos via a client-side map; third-party providers from the registry render without a logo. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Connectors: Use ucwords fallback for empty provider name When a third-party provider from the AI Client registry has no name, fall back to ucwords( $provider_id ) for a reasonable display label. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Add authentication_method to provider data structure Expose authentication_method ('api_key' or 'none') in provider settings instead of silently filtering out non-API-key providers. This makes the public-facing interfaces extensible for future authentication methods while still only implementing api_key support for now. - Include all registered providers regardless of auth method - Conditionally generate settings sub-array only for api_key providers - Expose authenticationMethod in script module data for the frontend - Skip non-api_key providers in the frontend registration loop - Rename ProviderConnector to ApiKeyProviderConnector for clarity Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Add type field to distinguish AI providers from other connectors Add a 'type' field ('ai_provider') to the provider data structure so credentials are only passed to the WP AI Client for AI providers. The frontend also filters by type, only rendering connectors for AI providers. This separates AI providers from future non-AI connectors and makes the intent of the API explicit. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Group authentication fields into sub-object and eliminate settings duplication Restructure provider data so credentials_url, setting_name, and method live together in an authentication sub-object rather than as flat top-level fields. Remove the redundant settings array from _gutenberg_get_provider_settings() and move register_setting logic (label, description, sanitize) into the consumer function. Update all PHP consumers to read from authentication directly. On the frontend, change ProviderAuthentication to a discriminated union type for type-safe access after narrowing on method. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Rename _gutenberg_get_provider_settings to _gutenberg_get_connector_settings Use the domain term "connector" consistently with the rest of the codebase (settings group, option names, script module filter). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Clarify authentication docblock for none method Document that credentials_url and setting_name are only present when method is 'api_key' and absent when method is 'none'. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Use URL hostname for help label instead of regex stripping Replace manual regex URL stripping with new URL().hostname for a cleaner, more robust extraction of the domain name used as the help link label. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Use type-based namespace for connector names Derive the connector name namespace from data.type instead of hardcoding 'core/'. Sanitize both parts to only allow letters, numbers, and hyphens. This produces names like 'ai-provider/google'. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Rename ApiKeyProviderConnector and derive helpLabel internally Rename ApiKeyProviderConnector to ApiKeyConnector and move helpLabel derivation from the registration loop into the component itself, since it already receives helpUrl. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Connectors: Rename _gutenberg_is_api_key_valid to _gutenberg_is_ai_api_key_valid The function is AI-provider-specific, so the name should reflect that. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Move sanitize helper outside the loop Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Pass plugin data from server instead of deriving slug client-side Hardcode plugin slugs for the three featured AI providers in PHP within a `plugin` sub-object and pass them to the client via script module data. When no plugin data is provided (e.g. dynamically registered providers), the install/activate UI is skipped and the connector assumes the plugin is already active. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add backport changelog entry for Core PR #11080 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Add remove_filter for Core script module data function Ensures the Gutenberg version overrides the equivalent Core function (_wp_connectors_get_connector_script_module_data), consistent with the pattern used by the other connector functions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Felix Arntz <flixos90@gmail.com> Co-authored-by: gziolo <gziolo@git.wordpress.org> Co-authored-by: raftaar1191 <raftaar1191@git.wordpress.org> Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org> Co-authored-by: felixarntz <flixos90@git.wordpress.org>
gutenbergplugin
pushed a commit
that referenced
this pull request
Mar 3, 2026
…#76014) * Connectors: Dynamically register providers from WP AI Client registry Polyfills WordPress/wordpress-develop#11080 for the Gutenberg plugin: - Expand `_gutenberg_get_provider_settings()` to dynamically fetch registered providers from the AI Client registry, in addition to the three hardcoded featured providers (Gemini, OpenAI, Claude). - Restructure the return value to be keyed by provider ID with `name`, `description`, `credentials_url` at the top level and `settings` as a nested array. - Filter out providers whose authentication method is not `api_key`. - Update all consumer functions to use the new structure. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Expose provider settings to the script module Pass provider data (name, description, credentials URL, setting keys) to the `connectors-wp-admin` script module via the `script_module_data` filter, making it available as inline JSON for the frontend to consume. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Register connectors dynamically from server-provided data Replace hardcoded per-provider connector components with a single dynamic loop that reads provider data from the script module data JSON tag. Known providers retain their SVG logos via a client-side map; third-party providers from the registry render without a logo. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Connectors: Use ucwords fallback for empty provider name When a third-party provider from the AI Client registry has no name, fall back to ucwords( $provider_id ) for a reasonable display label. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Add authentication_method to provider data structure Expose authentication_method ('api_key' or 'none') in provider settings instead of silently filtering out non-API-key providers. This makes the public-facing interfaces extensible for future authentication methods while still only implementing api_key support for now. - Include all registered providers regardless of auth method - Conditionally generate settings sub-array only for api_key providers - Expose authenticationMethod in script module data for the frontend - Skip non-api_key providers in the frontend registration loop - Rename ProviderConnector to ApiKeyProviderConnector for clarity Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Add type field to distinguish AI providers from other connectors Add a 'type' field ('ai_provider') to the provider data structure so credentials are only passed to the WP AI Client for AI providers. The frontend also filters by type, only rendering connectors for AI providers. This separates AI providers from future non-AI connectors and makes the intent of the API explicit. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Group authentication fields into sub-object and eliminate settings duplication Restructure provider data so credentials_url, setting_name, and method live together in an authentication sub-object rather than as flat top-level fields. Remove the redundant settings array from _gutenberg_get_provider_settings() and move register_setting logic (label, description, sanitize) into the consumer function. Update all PHP consumers to read from authentication directly. On the frontend, change ProviderAuthentication to a discriminated union type for type-safe access after narrowing on method. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Rename _gutenberg_get_provider_settings to _gutenberg_get_connector_settings Use the domain term "connector" consistently with the rest of the codebase (settings group, option names, script module filter). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Clarify authentication docblock for none method Document that credentials_url and setting_name are only present when method is 'api_key' and absent when method is 'none'. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Use URL hostname for help label instead of regex stripping Replace manual regex URL stripping with new URL().hostname for a cleaner, more robust extraction of the domain name used as the help link label. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Use type-based namespace for connector names Derive the connector name namespace from data.type instead of hardcoding 'core/'. Sanitize both parts to only allow letters, numbers, and hyphens. This produces names like 'ai-provider/google'. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Rename ApiKeyProviderConnector and derive helpLabel internally Rename ApiKeyProviderConnector to ApiKeyConnector and move helpLabel derivation from the registration loop into the component itself, since it already receives helpUrl. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Connectors: Rename _gutenberg_is_api_key_valid to _gutenberg_is_ai_api_key_valid The function is AI-provider-specific, so the name should reflect that. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Move sanitize helper outside the loop Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Pass plugin data from server instead of deriving slug client-side Hardcode plugin slugs for the three featured AI providers in PHP within a `plugin` sub-object and pass them to the client via script module data. When no plugin data is provided (e.g. dynamically registered providers), the install/activate UI is skipped and the connector assumes the plugin is already active. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add backport changelog entry for Core PR #11080 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Add remove_filter for Core script module data function Ensures the Gutenberg version overrides the equivalent Core function (_wp_connectors_get_connector_script_module_data), consistent with the pattern used by the other connector functions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Felix Arntz <flixos90@gmail.com> Co-authored-by: gziolo <gziolo@git.wordpress.org> Co-authored-by: raftaar1191 <raftaar1191@git.wordpress.org> Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org> Co-authored-by: felixarntz <flixos90@git.wordpress.org>
alecgeatches
pushed a commit
to Automattic/gutenberg
that referenced
this pull request
Mar 3, 2026
…WordPress#76014) * Connectors: Dynamically register providers from WP AI Client registry Polyfills WordPress/wordpress-develop#11080 for the Gutenberg plugin: - Expand `_gutenberg_get_provider_settings()` to dynamically fetch registered providers from the AI Client registry, in addition to the three hardcoded featured providers (Gemini, OpenAI, Claude). - Restructure the return value to be keyed by provider ID with `name`, `description`, `credentials_url` at the top level and `settings` as a nested array. - Filter out providers whose authentication method is not `api_key`. - Update all consumer functions to use the new structure. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Expose provider settings to the script module Pass provider data (name, description, credentials URL, setting keys) to the `connectors-wp-admin` script module via the `script_module_data` filter, making it available as inline JSON for the frontend to consume. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Register connectors dynamically from server-provided data Replace hardcoded per-provider connector components with a single dynamic loop that reads provider data from the script module data JSON tag. Known providers retain their SVG logos via a client-side map; third-party providers from the registry render without a logo. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Connectors: Use ucwords fallback for empty provider name When a third-party provider from the AI Client registry has no name, fall back to ucwords( $provider_id ) for a reasonable display label. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Add authentication_method to provider data structure Expose authentication_method ('api_key' or 'none') in provider settings instead of silently filtering out non-API-key providers. This makes the public-facing interfaces extensible for future authentication methods while still only implementing api_key support for now. - Include all registered providers regardless of auth method - Conditionally generate settings sub-array only for api_key providers - Expose authenticationMethod in script module data for the frontend - Skip non-api_key providers in the frontend registration loop - Rename ProviderConnector to ApiKeyProviderConnector for clarity Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Add type field to distinguish AI providers from other connectors Add a 'type' field ('ai_provider') to the provider data structure so credentials are only passed to the WP AI Client for AI providers. The frontend also filters by type, only rendering connectors for AI providers. This separates AI providers from future non-AI connectors and makes the intent of the API explicit. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Group authentication fields into sub-object and eliminate settings duplication Restructure provider data so credentials_url, setting_name, and method live together in an authentication sub-object rather than as flat top-level fields. Remove the redundant settings array from _gutenberg_get_provider_settings() and move register_setting logic (label, description, sanitize) into the consumer function. Update all PHP consumers to read from authentication directly. On the frontend, change ProviderAuthentication to a discriminated union type for type-safe access after narrowing on method. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Rename _gutenberg_get_provider_settings to _gutenberg_get_connector_settings Use the domain term "connector" consistently with the rest of the codebase (settings group, option names, script module filter). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Clarify authentication docblock for none method Document that credentials_url and setting_name are only present when method is 'api_key' and absent when method is 'none'. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Use URL hostname for help label instead of regex stripping Replace manual regex URL stripping with new URL().hostname for a cleaner, more robust extraction of the domain name used as the help link label. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Use type-based namespace for connector names Derive the connector name namespace from data.type instead of hardcoding 'core/'. Sanitize both parts to only allow letters, numbers, and hyphens. This produces names like 'ai-provider/google'. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Rename ApiKeyProviderConnector and derive helpLabel internally Rename ApiKeyProviderConnector to ApiKeyConnector and move helpLabel derivation from the registration loop into the component itself, since it already receives helpUrl. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Update lib/experimental/connectors/default-connectors.php Co-authored-by: Felix Arntz <flixos90@gmail.com> * Connectors: Rename _gutenberg_is_api_key_valid to _gutenberg_is_ai_api_key_valid The function is AI-provider-specific, so the name should reflect that. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Move sanitize helper outside the loop Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Pass plugin data from server instead of deriving slug client-side Hardcode plugin slugs for the three featured AI providers in PHP within a `plugin` sub-object and pass them to the client via script module data. When no plugin data is provided (e.g. dynamically registered providers), the install/activate UI is skipped and the connector assumes the plugin is already active. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add backport changelog entry for Core PR WordPress#11080 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Connectors: Add remove_filter for Core script module data function Ensures the Gutenberg version overrides the equivalent Core function (_wp_connectors_get_connector_script_module_data), consistent with the pattern used by the other connector functions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Felix Arntz <flixos90@gmail.com> Co-authored-by: gziolo <gziolo@git.wordpress.org> Co-authored-by: raftaar1191 <raftaar1191@git.wordpress.org> Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org> Co-authored-by: felixarntz <flixos90@git.wordpress.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
stylesproperty toblock apidocumentation