Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block Library: Don't use methods with the 'gutenberg_' prefix #47649

Merged
merged 1 commit into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/block-library/src/calendar/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function render_block_core_calendar( $attributes ) {
$color_block_styles['background'] = $preset_background_color ? $preset_background_color : $custom_background_color;

// Generate color styles and classes.
$styles = gutenberg_style_engine_get_styles( array( 'color' => $color_block_styles ), array( 'convert_vars_to_classnames' => true ) );
$styles = wp_style_engine_get_styles( array( 'color' => $color_block_styles ), array( 'convert_vars_to_classnames' => true ) );
$inline_styles = empty( $styles['css'] ) ? '' : sprintf( ' style="%s"', esc_attr( $styles['css'] ) );
$classnames = empty( $styles['classnames'] ) ? '' : ' ' . esc_attr( $styles['classnames'] );
if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) {
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/gallery/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function block_core_gallery_render( $attributes, $content ) {
),
);

gutenberg_style_engine_get_stylesheet_from_css_rules(
wp_style_engine_get_stylesheet_from_css_rules(
$gallery_styles,
array(
'context' => 'block-supports',
Expand Down
4 changes: 2 additions & 2 deletions packages/block-library/src/navigation-link/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ function register_block_core_navigation_link() {
* @param array $settings Default editor settings.
* @return array Filtered editor settings.
*/
function gutenberg_enable_animation_for_navigation_link_inspector( $settings ) {
function block_core_navigation_link_enable_inspector_animation( $settings ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do this quick fix for now(renaming), but we need to see what we're going to do with __experimentalBlockInspectorAnimation introduced here.

This setting is part of the auditing of experimental API for 6.2. @artemiomorales is this something that we want to stabilize or exclude from 6.2?

If the plan is to remain experimental, among the changes that will be needed, these functions(for the two other blocks) would need to be moved in different files and not remain here.

$current_animation_settings = _wp_array_get(
$settings,
array( '__experimentalBlockInspectorAnimation' ),
Expand All @@ -402,4 +402,4 @@ function gutenberg_enable_animation_for_navigation_link_inspector( $settings ) {
return $settings;
}

add_filter( 'block_editor_settings_all', 'gutenberg_enable_animation_for_navigation_link_inspector' );
add_filter( 'block_editor_settings_all', 'block_core_navigation_link_enable_inspector_animation' );
4 changes: 2 additions & 2 deletions packages/block-library/src/navigation-submenu/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ function register_block_core_navigation_submenu() {
* @param array $settings Default editor settings.
* @return array Filtered editor settings.
*/
function gutenberg_enable_animation_for_navigation_submenu_inspector( $settings ) {
function block_core_navigation_submenu_enable_inspector_animation( $settings ) {
$current_animation_settings = _wp_array_get(
$settings,
array( '__experimentalBlockInspectorAnimation' ),
Expand All @@ -320,4 +320,4 @@ function gutenberg_enable_animation_for_navigation_submenu_inspector( $settings
return $settings;
}

add_filter( 'block_editor_settings_all', 'gutenberg_enable_animation_for_navigation_submenu_inspector' );
add_filter( 'block_editor_settings_all', 'block_core_navigation_submenu_enable_inspector_animation' );
4 changes: 2 additions & 2 deletions packages/block-library/src/navigation/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ function block_core_navigation_typographic_presets_backcompatibility( $parsed_bl
* @param array $settings Default editor settings.
* @return array Filtered editor settings.
*/
function gutenberg_enable_animation_for_navigation_inspector( $settings ) {
function block_core_navigation_enable_inspector_animation( $settings ) {
$current_animation_settings = _wp_array_get(
$settings,
array( '__experimentalBlockInspectorAnimation' ),
Expand All @@ -905,4 +905,4 @@ function gutenberg_enable_animation_for_navigation_inspector( $settings ) {
return $settings;
}

add_filter( 'block_editor_settings_all', 'gutenberg_enable_animation_for_navigation_inspector' );
add_filter( 'block_editor_settings_all', 'block_core_navigation_enable_inspector_animation' );