Opened 7 years ago
Closed 7 years ago
#44069 closed defect (bug) (duplicate)
Private posts are not displayed in "Insert link" editor modal box
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Editor | Keywords: | has-patch |
Focuses: | ui, administration | Cc: |
Description
Steps to reproduce :
- login to WordPress back-office with an "administrator" account
- create an post with "private" visibility and save it
- click on "Articles/Create new" on sidebar
- click on "Insert link" icon in editor
- type a word which is present on the "private post" title you just created
You can also click on the "wheel" and make a search with the same word
What happens
The "private post" is not displayed in search results
What should happen
The "private post" is displayed in search results
Attachments (1)
Change History (6)
#1
@
7 years ago
- Keywords has-patch 2nd-opinion added
Hi @fetard thank for this ticket,
In 44069.1.diff
:
- Added private posts to
wp_link_query()
query
I'm not sure this is relevant, so if this is too specific for the general use case and closed as wontfix
by the core team, @fetard I guess you can use wp_link_query_args
filter to add private posts in your specific project :)
Cheers,
Jb
#2
@
7 years ago
@fetard If I have not understood wrong, by saying "search result" you meant the inline search which lists you list of available pages when typing in a keyword for adding a link.
To my understanding (may be wrong), if you are marking a post Private, the post can no way be displayed or even no link to it should be displayed by other posts to anonymous (not yet logged in). Since, you are not supposed to link a Private post directly from any other post, the private page link is not showing up.
Because if this new page is Published with Public visibility, the link will also be visible inside it. If a visitor clicks on it, he will land on a page saying something like Oops! That page can’t be found (message in twentyseventeen theme)
Now if you Publish your Private page and then try to link this from another page, it will be included and appear in search (list of available that could be linked).
I believe the filtration is intentional since Private pages are always meant to be protected from anonymous users.
The suggested patch brings up a private page in the list, but I don't think we really require this.
#3
follow-up:
↓ 4
@
7 years ago
Wouldn't it be useful to also check user capabilities? Like read_private_posts
capability.
#4
in reply to:
↑ 3
@
7 years ago
Replying to nicomollet:
Wouldn't it be useful to also check user capabilities? Like
read_private_posts
capability.
I think @subrataemfluence is right, this limit prevents user to insert in a public article towards a private content
add private contents to wplink query