Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#41426 closed enhancement (fixed)

Admin: Password protected text class in the posts list

Reported by: slaffik's profile slaFFik Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.9 Priority: normal
Severity: normal Version:
Component: Administration Keywords: has-patch has-screenshots
Focuses: Cc:

Description

Password protected posts (and CPTs) have this text as a fallback for excerpt in the list of posts:

There is no excerpt because this is a protected post.

They should have a proper span with a class like .post-password-state, like it's done with "Password protected" text and its .post-state.

This will allow to better customize the styles of the screen.

Attachments (5)

41426.patch (713 bytes) - added by mp518 7 years ago.
password-protected-post-state this class added in this patch
41426.2.patch (703 bytes) - added by mp518 7 years ago.
post-password-state this class added in this patch(optional)
41426.3.diff (495 bytes) - added by Soean 7 years ago.
41426.3.patch (576 bytes) - added by mp518 7 years ago.
added class
41426.4.diff (1.5 KB) - added by Soean 7 years ago.
Adds tests

Download all attachments as: .zip

Change History (20)

#1 @SergeyBiryukov
7 years ago

  • Keywords needs-patch good-first-bug added
  • Milestone changed from Awaiting Review to Future Release

#2 @mp518
7 years ago

  • Keywords has-patch added; needs-patch removed
  • Version set to trunk

Hy i have added patch when post comes with password protected this class is added.
If i have something wrong then let me know.

Thank You,
Mahesh

@mp518
7 years ago

password-protected-post-state this class added in this patch

@mp518
7 years ago

post-password-state this class added in this patch(optional)

#3 @Soean
7 years ago

  • Keywords needs-refresh added; has-patch removed

@mp518
This ticket is about the string There is no excerpt because this is a protected post. in get_the_excerpt.
See: https://core.trac.wordpress.org/browser/trunk/src/wp-includes/post-template.php#L385

#4 @mp518
7 years ago

  • Keywords has-patch added; needs-refresh removed

Hey @Soean,

alright i got it and i will add new patch with the string.

Last edited 7 years ago by mp518 (previous) (diff)

#5 @mp518
7 years ago

  • Keywords needs-refresh added; has-patch removed

@Soean
7 years ago

#6 @Soean
7 years ago

41426.3.diff adds a span with .post-password-state class around the post password required string in get_the_excerpt().

#7 @mp518
7 years ago

This is return all thing like <span class="post-password-state">There is no excerpt because this is a protected post.</span>

Last edited 7 years ago by mp518 (previous) (diff)

@mp518
7 years ago

added class

#8 @mp518
7 years ago

  • Keywords has-patch added; needs-refresh removed

@Soean
7 years ago

Adds tests

#9 @Soean
7 years ago

  • Keywords good-first-bug removed

41426.4.diff corrects the tests of get_the_excerpt().

@mp518 Please don't use echoin aget_ function.

#10 @afercia
7 years ago

  • Keywords has-screenshots added
  • Version trunk deleted

For reference: visible when switching to "Excerpt View" from the Screen Options:

https://cldup.com/T0yBLdio9S.png

Re: the CSS class name, maybe it would be better a name that clearly identifies what that text is.

#11 @SergeyBiryukov
7 years ago

  • Milestone changed from Future Release to 4.9

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


7 years ago

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


7 years ago

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


7 years ago

#15 @SergeyBiryukov
7 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 41770:

Administration: Add .protected-post-excerpt class to password-protected post excerpts in the posts list.

Props Soean, mp518, slaFFik, SergeyBiryukov.
Fixes #41426.

Note: See TracTickets for help on using tickets.