WordPress.org

Make WordPress Core

#44071 closed defect (bug) (duplicate)

Unreachable condition in elseIF

Reported by: akshayar Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.9.5
Component: General Keywords: needs-patch
Focuses: Cc:
PR Number:

Description (last modified by swissspidy)

There is duplicate 'is_post_type_archive' conditional check-in 'elseif' condition. You can check 'feed_links_extra()' function located at 'general-template.php' file under 'wp-includes' directory conatains,

https://github.com/WordPress/WordPress/blob/e76593098293fd1e87d666bd3acf339b46fd5110/wp-includes/general-template.php#L2799

This block will never get executed.

Attachments (2)

feed-link.patch (1.1 KB) - added by akshayar 19 months ago.
feed-link-modified.patch (1.1 KB) - added by akshayar 19 months ago.

Download all attachments as: .zip

Change History (5)

#1 @swissspidy
19 months ago

  • Description modified (diff)
  • Keywords needs-patch added; has-patch removed

#2 @akshayar
19 months ago

Both blocks of code have a difference in fetching '$post_type_obj' and in generating the title. We can add an extra check to validate 'post_type_obj' and the attached ('feed-link-modified.patch') patch can be used.
As feed link for the archive is working, not changed reference in the earlier block.

#3 @desrosj
19 months ago

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

Thanks for the ticket and patches, @akshayar. #43860 has more discussion, so closing this ticket out as a duplicate.

Note: See TracTickets for help on using tickets.