WordPress.org

Make WordPress Core

Opened 21 months ago

Closed 21 months ago

Last modified 21 months ago

#21423 closed defect (bug) (invalid)

wp_list_pages() is not aware of the current page inside the loop so the correct css classes are not set

Reported by: thedaysse Owned by:
Milestone: Priority: normal
Severity: trivial Version: 3.4.1
Component: General Keywords: reporter-feedback
Focuses: Cc:

Description

Because is_page() doesn't work inside the loop any widget that calls wp_list_pages() also fails to put the right css on the generated list. The fix is for wp_list_pages() to have an extra option so we can tell it explicitly what $ID we are on when we call it:

'current_page' => 0, would do it

Fixing is_page() and is_singular() so that they give the expected results inside the loop would also solve the issue

Change History (3)

comment:1 nacin21 months ago

  • Keywords reporter-feedback added

Can you provide some code to reproduce your problem? I'm not sure I understand "Because is_page() doesn't work inside the loop any widget that calls wp_list_pages() also fails". is_page() works just fine anywhere in a theme, based on whatever the main loop is.

comment:2 thedaysse21 months ago

  • Resolution set to invalid
  • Severity changed from minor to trivial
  • Status changed from new to closed

Hi
This is a false alarm and safe to close - caused by the plugin "Map Categories to Pages". I haven't yet figured out just what the plugin does that breaks all the is_ functions.

comment:3 SergeyBiryukov21 months ago

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