gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Enhancement: Post Terms Without Links

Open Sisanu opened this issue 2 years ago • 17 comments

What?

  • Added a new block attribute called "isLink" (boolean)
  • Added a new block attribute called "linkTarget" (string)
  • Removes the terms links on block SSR and wraps the names of the terms in "span" tags (for styling purposes and also differentiate from separator) when the "isLink" attribute is false

Related to #50904

Why?

  • When using terms that should not link to archives, there is no option to remove the links from the terms output.

How?

  • A new optional attribute

Testing Instructions

  • Add categories to a post.
  • Insert the "Post Category" block in the post content.
  • Use the new toggle that appears in the "Advanced" panel from the sidebar.

Testing Instructions for Keyboard

Screenshots or screencast

gutenberg-terms-links

Sisanu avatar May 25 '23 09:05 Sisanu

Thank you for working on this. Small note: When we add a block attribute, the documentation needs to be updated. The command to update the documentation is: npm run docs:build

carolinan avatar May 29 '23 08:05 carolinan

@carolinan, thank you for the feedback! Will look into replacing the code with the get_the_terms() as you suggested and see if that makes it better.

Sisanu avatar May 29 '23 08:05 Sisanu

@carolinan, your idea is better from both perspectives. Since we already get the post terms a few lines above in the code, we can reuse that, and also safer for output like that. Thanks! Please check again.

Sisanu avatar May 29 '23 08:05 Sisanu

Hi! It's been a while since working on this, so I rebased the code to be up to date with the trunk. It's ready again for picking up the conversation if anyone has availability. Thanks!

Sisanu avatar Jul 14 '23 09:07 Sisanu

Hi! It's been a while since working on this. It's ready again for picking up the conversation if anyone has availability. Thanks!

Sisanu avatar Oct 17 '24 12:10 Sisanu

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Sisanu <[email protected]>
Co-authored-by: carolinan <[email protected]>
Co-authored-by: krstivoja <[email protected]>
Co-authored-by: t-hamano <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

github-actions[bot] avatar Oct 17 '24 12:10 github-actions[bot]

Hi @Sisanu the merge conflicts need to be solved.

carolinan avatar Oct 28 '24 09:10 carolinan

@carolinan, the branch has been rebased and is ready for resuming the review. Thanks!

Sisanu avatar Oct 28 '24 18:10 Sisanu

To match other similar options, I still think it would be better to move it out of the Advanced section.

The author name for example also links to the author archive by default, and it shows the link setting as enabled by default: image

carolinan avatar Oct 29 '24 08:10 carolinan

core-post-terms

@carolinan, similar attributes have been applied to the block, as per your suggestion. Please review. Thanks!

Sisanu avatar Oct 29 '24 09:10 Sisanu

Any updates on this?

krstivoja avatar Apr 20 '25 08:04 krstivoja

@krstivoja All code changes and conversations are public, so if there are none listed here, then there are no updates.

If you scroll down to the test results, this PR is failing two tests and it has a merge conflict. These must be resolved.

carolinan avatar Apr 20 '25 10:04 carolinan

If you scroll down to the test results, this PR is failing two tests and it has a merge conflict. These must be resolved.

That is a consequence of not receiving any feedback for months, after making the changes suggested in the previous comments. If only rebasing the code would unblock this from getting attention, I will do that soon. Is there some more suggestions you have @carolinan, to include these in the next push if any?

Sisanu avatar Apr 20 '25 11:04 Sisanu

I am not able to do take it on, and I can't speak for anyone else.

carolinan avatar Apr 20 '25 12:04 carolinan

Thanks @carolinan for clarifying it

krstivoja avatar Apr 20 '25 12:04 krstivoja

@carolinan, @krstivoja, this is done, just letting you know of the development. My terrible rebase 😅 triggered review requests from more people, it wasn't intentional and I apologize for the SPAM cascade, I know everyone is busy.

Sisanu avatar Apr 23 '25 17:04 Sisanu

Nice. Really appreciate the heads up!

krstivoja avatar Apr 23 '25 19:04 krstivoja

It's ready again for picking up the conversation if anyone has availability. Thanks!

Sisanu avatar Jun 06 '25 07:06 Sisanu