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

Custom template part name not showing correctly in Site Editor #52859

Closed
bgardner opened this issue Jul 23, 2023 · 4 comments
Closed

Custom template part name not showing correctly in Site Editor #52859

bgardner opened this issue Jul 23, 2023 · 4 comments

Comments

@bgardner
Copy link

bgardner commented Jul 23, 2023

Description

I am experimenting with creating custom template part (Query) per @justintadlock’s tutorial: https://developer.wordpress.org/news/2023/06/upgrading-the-site-editing-experience-with-custom-template-part-areas/

Everything seems to be working properly, with the exception of the Site Editor, where the Query template part is still showing as Uncategorized. For context, here is the code I am using to register in my functions.php file:

/**
 * Register Query template part.
 *
 * @since 0.9.4
 */
function powder_query_template_part( array $areas ) {
	$areas[] = array(
		'area'        => 'query',
		'area_tag'    => 'section',
		'label'       => __( 'Query', 'powder' ),
		'description' => __( 'Custom description', 'powder' ),
		'icon'        => 'query'
	);

	return $areas;
}

add_filter( 'default_wp_template_part_areas', 'powder_query_template_part' );

Step-by-step reproduction instructions

  1. Use function code from above to register the custom template part.
  2. Access Site Editor screen to see Uncategorized template part name.

Screenshots, screen recording, code snippet

Screenshot showing Uncategorized (incorrect, should be Query) template part:

image

Screenshot showing Query (correct) on the edit Template Parts screen:

image

Environment info

WordPress 6.3-RC1
Gutenberg active

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@justintadlock
Copy link
Contributor

This should be fixed by: #52355

You can test with 16.3.0 RC 1: https://github.com/WordPress/gutenberg/releases/tag/v16.3.0-rc.1

@bgardner
Copy link
Author

@justintadlock Ah yes, it is working. Confirmed. By any chance can we expect at some point the same "Replace Header" and "Replace Footer" functionality that we see in templates for Header and Footer template parts? It would be great for users to easily replace the contents of the Query template part with a selection of Query patterns. (Default, List, Grid, etc)

@justintadlock
Copy link
Contributor

There's a ticket for it here: #44689

I'm hoping we can get that in for WordPress 6.4.

@bgardner
Copy link
Author

Closing this issue as I have confirmed @justintadlock's comment about this being fixed in 16.3.0-RC1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants