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

Issue-236: Subquery block missing support for custom post titles #256

Merged

Conversation

mogmarsh
Copy link
Collaborator

@mogmarsh mogmarsh commented Nov 18, 2024

Summary

Fixes #236 - Subquery block missing support for custom post titles.

Description of the bug

Adding a Subquery block does not include a post title in the block title. Initially, setting a custom post title was not available within a Subquery block.

Steps To Reproduce

  1. Create a new Query block.
  2. Add a nested Subquery block within the Post Template.
  3. Core Post Title block is inserted.

Solution

Support for custom post titles within Subquery blocks has been added, allowing users to set custom titles for posts within these blocks.

Additional Information

When hardcoding the Custom Post Title block, it's possible to set a custom title. However, the value is set on the Query block and is used for any duplicate instance of the post within the Query.

Example code for creating Query with Subquery

<!-- wp:wp-curate/query {"postTypes":["post"],"posts":[null,null,null,null,null]} -->
<div class="wp-block-wp-curate-query"><!-- wp:post-template -->
<!-- wp:wp-curate/post -->
<div class="wp-block-wp-curate-post"><!-- wp:post-title {"isLink":true} /-->

<!-- wp:wp-curate/subquery {"numberOfPosts":2,"postTypes":[{"name":"Post","slug":"post"}],"posts":[null,null],"terms":{"category":[], "post_tag":[]},"uniqueId":"87552371-c7f9-4175-9105-d5ab61240864"} -->
<div class="wp-block-wp-curate-subquery"><!-- wp:post-template -->
<!-- wp:wp-curate/post -->
<div class="wp-block-wp-curate-post"><!-- wp:post-title {"level":3,"isLink":true} /--></div>
<!-- /wp:wp-curate/post -->
<!-- /wp:post-template --></div>
<!-- /wp:wp-curate/subquery --></div>
<!-- /wp:wp-curate/post -->
<!-- /wp:post-template --></div>
<!-- /wp:wp-curate/query -->

@mogmarsh mogmarsh marked this pull request as ready for review November 18, 2024 19:01
Copy link
Contributor

@efuller efuller left a comment

Choose a reason for hiding this comment

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

I manually tested this functionality and it does only work with pinned posts in the subquery block. The code for post-title does indicate that this is intentional.

CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Eric Fuller <[email protected]>
@mogmarsh mogmarsh enabled auto-merge November 20, 2024 14:34
@mogmarsh mogmarsh merged commit 19dfe4a into develop Nov 20, 2024
5 checks passed
@mogmarsh mogmarsh deleted the feature/issue-236/subquery-block-custom-post-titles-support branch November 20, 2024 14:35
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

Successfully merging this pull request may close these issues.

Subquery block missing support for custom post titles
2 participants