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: Rename variation build methods #58538

Merged
merged 1 commit into from
Feb 1, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions packages/block-library/src/navigation-link/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -375,12 +375,11 @@ function block_core_navigation_link_unregister_variation( $name ) {
}

/**
* Register the navigation link block.
* Returns an array of variations for the navigation link block.
*
* @return array
*/
function build_navigation_link_block_variations() {
function block_core_navigation_link_build_variations() {
// This will only handle post types and taxonomies registered until this point (init on priority 9).
// See action hooks below for other post types and taxonomies.
// See https://github.com/WordPress/gutenberg/issues/53826 for details.
Expand Down Expand Up @@ -429,7 +428,7 @@ function register_block_core_navigation_link() {
__DIR__ . '/navigation-link',
array(
'render_callback' => 'render_block_core_navigation_link',
'variation_callback' => 'build_navigation_link_block_variations',
'variation_callback' => 'block_core_navigation_link_build_variations',
)
);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/block-library/src/post-terms/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function render_block_core_post_terms( $attributes, $content, $block ) {
*
* @return array The available variations for the block.
*/
function build_post_term_block_variations() {
function block_core_post_terms_build_variations() {
$taxonomies = get_taxonomies(
array(
'publicly_queryable' => true,
Expand Down Expand Up @@ -116,7 +116,7 @@ function register_block_core_post_terms() {
__DIR__ . '/post-terms',
array(
'render_callback' => 'render_block_core_post_terms',
'variation_callback' => 'build_post_term_block_variations',
'variation_callback' => 'block_core_post_terms_build_variations',
)
);
}
Expand Down
2 changes: 0 additions & 2 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@
<element value="apply_block_core_search_border_style"/>
<element value="apply_block_core_search_border_styles"/>
<element value="build_dropdown_script_block_core_categories"/>
<element value="build_navigation_link_block_variations"/>
<element value="build_post_term_block_variations"/>
<element value="build_template_part_block_area_variations"/>
<element value="build_template_part_block_instance_variations"/>
<element value="build_template_part_block_variations"/>
Expand Down
Loading