Skip to content

When a block style is registered for the query, the "Create a new post for this feed." link is in the Style section #49327

@carolinan

Description

@carolinan

Description

When you register a custom block style for the query (with register_block_style or the JavaScript equivalent) the link to where you add a new post to the query is in Styles section.

This is a bit difficult to explain without the screenshot:
When you open the block settings sidebar,
The link to add new posts is below the title "Styles" and below the buttons that you use to select the style variation.

Step-by-step reproduction instructions

Register any block style for the query loop.
My example looks like this:

<?php
/**
 * Register block styles.
 */
function blue_note_register_block_styles() {
	register_block_style(
		'core/query',
		array(
			'name'  => 'blue-note-query-slant',
			'label' => __( 'Slanted images', 'blue-note' ),
			'inline_style' => '.is-style-blue-note-query-slant .wp-block-post-featured-image {transform: rotate(-1deg);}',
		)
	);
}
add_action( 'init', 'blue_note_register_block_styles' );

Open the block editor.
Add a query block.
View the Styles section in the block settings sidebar.

Screenshots, screen recording, code snippet

Missplaced link in the styles section

Environment info

No response

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

Metadata

Metadata

Labels

[Block] Query LoopAffects the Query Loop Block[Type] BugAn existing feature does not function as intended

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions