Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#35570 closed feature request (worksforme)

Search for Post/Pages isn't working

Reported by: mumbomedia's profile mumbomedia Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.4.1
Component: Query Keywords:
Focuses: administration Cc:

Description

On Dashboard goto either Pages or Post.
Then type something in the input on the right side and click on the button right to it. In the german version it is called "Beiträge durchsuchen" for Posts and "Seiten durchsuchen" for Pages.

Regardless of what your fill in, it seems that no search is executed.

Please fix it asap.

Change History (5)

#1 follow-up: @SergeyBiryukov
9 years ago

  • Component changed from General to Query
  • Keywords reporter-feedback added

Hi @mumbomedia, welcome to Trac!

I could not reproduce the issue on a clean install. Does it still happen with all plugins disabled and a default theme (Twenty Sixteen or Twenty Fifteen) activated?

#2 in reply to: ↑ 1 @mumbomedia
9 years ago

  • Keywords close added
  • Resolution set to worksforme
  • Status changed from new to closed
  • Type changed from defect (bug) to feature request

Replying to SergeyBiryukov:

Hi @mumbomedia, welcome to Trac!

I could not reproduce the issue on a clean install. Does it still happen with all plugins disabled and a default theme (Twenty Sixteen or Twenty Fifteen) activated?

-No, I did the changes you've suggested step by step.

  1. I deactivated all plugins -> Result: No changes
  2. I switched to default theme Twenty Fifteen -> Result: Search is working
  3. I switched back to my parents theme -> Result: Search is working

Thanks to you I found the code that is causing it.
I have deactivate the search in the functions.php of my child theme, because I don't want to use the default search on the frontend (users view). But on backend (admins view) the search should work as expected. So I have to determine if the request cames either from front- or backend. I will look in the codex if there is a function which tells me if I am on front- or backend.

Update:
I've found the function I was looking for is_admin. I've alter my if-statement to if(is_search() && !is_admin()) and now it works like a charm.

Last edited 9 years ago by mumbomedia (previous) (diff)

#3 @mumbomedia
9 years ago

  • Keywords reporter-feedback close removed

#4 @mumbomedia
9 years ago

  • Keywords close added

#5 @netweb
9 years ago

  • Keywords close removed
  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.