Make WordPress Core

Opened 11 years ago

Closed 8 years ago

#25455 closed feature request (wontfix)

Breadcrumb API

Reported by: apiweb's profile Apiweb Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Template Keywords:
Focuses: Cc:

Description

I think a cool addition to WordPress, as well as the menus and widgets, would be an API for Breadcrumb so the pages, posts, categories, themes and plugins might use this API and so have a breadcrumb more consistent across the entire environment WordPress .

Attachments (3)

add-wp-breadcrumbs.patch (3.4 KB) - added by cardiganmedia 9 years ago.
Template tag for standardizing breadcrumb navigation
add-wp_breadcrumbs-2.patch (3.3 KB) - added by cardiganmedia 9 years ago.
New version of breadcrumbs template tag
wp-breadcrumbs-3.patch (3.8 KB) - added by cardiganmedia 9 years ago.

Download all attachments as: .zip

Change History (19)

#1 @SergeyBiryukov
11 years ago

Previously: #4861. Related: #21506.

Sounds like plugin territory to me. Should probably be suggested as a feature plugin first.

#2 @SergeyBiryukov
11 years ago

  • Component changed from General to Template

#3 follow-up: @helen
11 years ago

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

Agree with plugin territory. Demand for it in core has not been noticeable. As always, welcome to re-open later, but would do the plugin thing first.

#4 in reply to: ↑ 3 @Apiweb
11 years ago

Replying to helen:

Agree with plugin territory. Demand for it in core has not been noticeable. As always, welcome to re-open later, but would do the plugin thing first.

Quick question, did not understand why he is plugin. I would change the core. Since WordPress itself would provide an API for Breadcrumbs, where themes and plugins might use it, as with Menus and Widgets.
Would not a plugin, but something that the very core of WordPress would provide.

#5 @chipbennett
10 years ago

I'm going to submit a patch for this, under a different ticket (I don't think an API is needed; just a core template tag).

Over the past four years reviewing Themes, I have seen the breadcrumb navigation wheel re-invented many times over by Theme developers. Breadcrumb navigation is standard template functionality. Non-core solutions are sub-optimal, IMHO. Not having a core template tag for breadcrumb navigation forces Theme developers either to rely on a Plugin for basic template functionality, or else develop custom code for a very common feature. Relegating breadcrumb navigation to Plugin territory would be analogous to saying paginate_links() or posts_nav_link()/previous_posts_link()/next_posts_link() are Plugin territory.

#6 @SergeyBiryukov
9 years ago

#31649 was marked as a duplicate.

@cardiganmedia
9 years ago

Template tag for standardizing breadcrumb navigation

#7 @cardiganmedia
9 years ago

  • Resolution wontfix deleted
  • Status changed from closed to reopened

Just attached a patch from my duplicate feature-request ticket.

#8 @SergeyBiryukov
9 years ago

  • Milestone set to Awaiting Review

#9 @wlindley
9 years ago

Submitted patch has extra, unclosed <div> in the 'page' handler. I suggest this function, if in core, should return a list of hashes, in the same format as get_bookmarks(), and let the plugin/theme handle any desired HTML generation. I have suggested a modification of the patch to @cardiganmedia.

#10 @cardiganmedia
9 years ago

I'm tweaking this patch a bit -- adding an option to return or echo, and streamlining some code. I'll upload the new version tonight.

#11 @cardiganmedia
9 years ago

I've made a few tweaks to clean things up a bit, and also added an echo argument for better user control, as well as a filter (wp_breadcrumb_args) for argument filtering.

@cardiganmedia
9 years ago

New version of breadcrumbs template tag

#12 @wlindley
9 years ago

What about the case where a Page sits several below levels of parents; shouldn't this walk the tree of parents until we get to root? That could be parent = 0 or, if ('page' == get_option('show_on_front')) then the root page's id is get_option('page_on_front').

#13 @cardiganmedia
9 years ago

Will have a new patch with full ancestor path by tomorrow. I'm still testing things.

#14 @cardiganmedia
9 years ago

New version that builds the full path for pages. I'd love to see input from others regarding possible improvements here.

This ticket was mentioned in Slack in #themereview by jcastaneda. View the logs.


9 years ago

#16 @swissspidy
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from reopened to closed

No movement in over 15 months and a clear suggestion to use a plugin instead (and perhaps making a feature project out of it).

Note: See TracTickets for help on using tickets.