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

Show result of admin_post_thumbnail_html filter in Featured Image panel #12742

Open
jaymanpandya opened this issue Dec 9, 2018 · 22 comments
Open
Labels
[Feature] Document Settings Document settings experience Needs Decision Needs a decision to be actionable or relevant [Type] Enhancement A suggestion for improvement.

Comments

@jaymanpandya
Copy link

Right now users do not understand where and how the uploaded Featured Image will be shown on the site

The area from where Featured Image is uploaded is very concise and does not have information on how the uploaded Featured Image will be used in the theme. This can cause confusion amongst the users who have not made their own theme. This issue can amplify if the uploaded image is used in different size through out the site and users will not test across the site and won't know how the image is appearing.

We can have short descriptions as suggested in the examples below to describe the behaviour of the uploaded Featured Image on the site.

Examples:

  • The featured image will be shown on archives next to the optional excerpt of posts.
  • 3 different sizes of featured image will be used: 50px - shown next to the post title in sidebar headlines. 150px - shown next to post excerpts on the homepage and archives. 500px - shown in the slider on the homepage.

This ticket was created based on a very old ticket on Trac (https://core.trac.wordpress.org/ticket/13522)

@swissspidy swissspidy added [Feature] Document Settings Document settings experience Needs Design Feedback Needs general design feedback. labels Dec 10, 2018
@joyously
Copy link

Can we reinstate the filter that used to exist for this in the old editor? admin_post_thumbnail_html

@jerclarke
Copy link

That would be a good start of course. I (original ticket author) didn't realize Gutenberg had stomped that filter.

Definitely need that filter to continue working, as it's the only reason this ticket was allowed to get so stale.

The point of the ticket was to create an easy-to-use API to register this information for display, like the description field that widgets and sidebars have.

@melchoyce
Copy link
Contributor

@joyously Can you make a new issue for that?

@joyously
Copy link

joyously commented Jun 4, 2019

No, as it's pretty much the conclusion from the Trac ticket discussion, so it's a big part of this issue.

@mapk
Copy link
Contributor

mapk commented Jun 4, 2019

The Featured Image module in the Inspector is void of text, so it does require the user to have some sort of knowledge to interact successfully with it. Because of this reason, I'm for adding something to the module to help explain what a Feature Image is, or how it's used.

Current Featured Image module

Screen Shot 2019-06-04 at 10 27 05 AM

@mapk
Copy link
Contributor

mapk commented Nov 12, 2019

In today's Design Team slack chat, we agreed that it would be great to get this filter implemented back. This would allow the themes to provide a Featured Image description.

@mapk mapk added Needs Dev Ready for, and needs developer efforts and removed Needs Design Feedback Needs general design feedback. labels Nov 12, 2019
@quasiDigi
Copy link

It would be nice to have the admin_post_thumbnail_html back. So we can add extra text and also extra fields. The best example is the "show feature image on top of the post page" option.
Thx!

@rickyfang
Copy link

Any updates on this feature guys? Our users would really appreciate it.

@mapk mapk added the Good First Issue An issue that's suitable for someone looking to contribute for the first time label Apr 14, 2020
@skorasaurus
Copy link
Member

Does the editor.PostFeaturedImage filter fulfill what you're looking to do?

The PR implementing this filter mentions that it acts like admin_post_thumbnail_html. More info at https://github.com/WordPress/gutenberg/blob/master/packages/editor/src/components/post-featured-image/README.md

@joyously
Copy link

If that filter simply "acts like" a PHP filter, it's not the same thing as being a PHP filter. What should happen is the PHP filter that is documented and called by existing code should affect the new editor the same way it affects the old editor, without needing JS code to be added by the legacy plugin or theme in order to work.

@eric-michel
Copy link

@joyously, agree here. I was just trying to use this documented filter before realizing it didn't work in Gutenberg. Our theme is set up to use Featured Images differently depending on settlings chosen in the customizer, so we need a PHP filter that can conditionally change the help text based on those selected settings.

The Featured Image input is incredibly unclear on what it does, and is indeed confusing our clients. Is there any inertia to get this fixed?

@joyously
Copy link

It seems like it would be pretty simple. Maybe if you ask in the #core-editor channel for someone to add this to the next milestone?
By the way, you need momentum to overcome inertia. There's plenty of inertia already.

@eric-michel
Copy link

@joyously Thanks! I will see about popping in there to get a feel for where they are. I wish I could work on this myself but am still way out of my depth with React.

@noisysocks
Copy link
Member

Closing this in favour of #30904.

@noisysocks noisysocks closed this as not planned Won't fix, can't repro, duplicate, stale Jul 15, 2022
@joyously
Copy link

The other issue (30904) doesn't even mention anything about the PHP filter.

@noisysocks
Copy link
Member

My mistake. Let's keep #30904 for adding help text and this issue for respecting the existing Core filter.

@noisysocks noisysocks reopened this Jul 15, 2022
@noisysocks noisysocks changed the title Add "description" setting for featured image and show that text in the area where Featured Image is uploaded Show result of admin_post_thumbnail_html filter in Featured Image panel Jul 15, 2022
@Mamaduka
Copy link
Member

Mamaduka commented Oct 5, 2022

I believe the path forward is to use the editor.PostFeaturedImage filter.

Here's an example migration guide - https://github.com/danielbachhuber/gutenberg-migration-guide/blob/master/filter-admin-post-thumbnail-html.md.

I think we can close this as "won't fix" and "has migration path."

@joyously
Copy link

joyously commented Oct 5, 2022

Why choose to make every theme or plugin add JS, when it would be better for core to do the migration instead? Why remove functionality that has been there for a long time and is still documented?
Please reread the comments on this issue.

@Mamaduka Mamaduka added Needs Decision Needs a decision to be actionable or relevant and removed Good First Issue An issue that's suitable for someone looking to contribute for the first time Needs Dev Ready for, and needs developer efforts labels Oct 7, 2022
@benwallis
Copy link

I think this filter admin_post_thumbnail_html is broken in the Classic Editor now. When I use it, the Featured Image assigned to a post cannot be updated/saved/deleted.

@joyously
Copy link

joyously commented Nov 8, 2022

I think this filter admin_post_thumbnail_html is broken in the Classic Editor now. When I use it, the Featured Image assigned to a post cannot be updated/saved/deleted.

Because of this comment, I tested it on WP 6.1. That filter works fine in Classic editor, as does the setting and deleting the featured image.
This issue is about having that filter be useful in the block editor.

@benwallis
Copy link

benwallis commented Nov 8, 2022

I think this filter admin_post_thumbnail_html is broken in the Classic Editor now. When I use it, the Featured Image assigned to a post cannot be updated/saved/deleted.

Because of this comment, I tested it on WP 6.1. That filter works fine in Classic editor, as does the setting and deleting the featured image. This issue is about having that filter be useful in the block editor.

Ah, sorry. I was checking $screen-post_type in the filter but apparently the ajax call also applies the filter (where it is not set), which was causing a PHP warning.

@BlackStar1991
Copy link

Has anyone found an answer to this question in 2023? WP vercion 6.2

@jordesign jordesign added the [Type] Enhancement A suggestion for improvement. label Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Document Settings Document settings experience Needs Decision Needs a decision to be actionable or relevant [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests