Make WordPress Core

Opened 5 years ago

Closed 2 months ago

#51246 closed defect (bug) (worksforme)

single_post_title() doesn't respect private and protected posts

Reported by: henrywright's profile henry.wright Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords:
Focuses: Cc:

Description

single_post_title() doesn't respect private and protected content. It will either display or return the content regardless.

In contrast, get_the_title() does respect private and protected content.

Note single_post_title() is used when building the document title in wp_get_document_title().

Change History (2)

#1 @SergeyBiryukov
5 years ago

  • Component changed from General to Posts, Post Types

#2 @SirLouen
2 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Reproduction Report

Description

❌ This report can't validate that the issue can be reproduced.

Environment

  • WordPress: 6.9-alpha-60093-src
  • PHP: 8.2.29
  • Server: nginx/1.29.1
  • Database: mysqli (Server: 8.4.6 / Client: mysqlnd 8.2.29)
  • Browser: Chrome 139.0.0.0
  • OS: Windows 10/11
  • Theme: Minimal Theme 1.0.0
  • MU Plugins: None activated
  • Plugins:
    • BBB Testing Dolly
    • Test Reports 1.2.0

Testing Instrutions

  1. Add single_post_title() to a single.php template file
  2. Create a Private Post
  3. Access the post without being logged in
  4. 👌 Title cannot be seen as expected

Actual Results

  1. ❌ Error condition is not ocurring

Additional Notes

  • Given that this cannot be not reproduced any more, its time to close this as worksforme
Note: See TracTickets for help on using tickets.