Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#13447 closed task (blessed) (fixed)

Allow new pages to be assigned to a menu

Reported by: nacin's profile nacin Owned by: nacin's profile nacin
Milestone: 3.0 Priority: normal
Severity: normal Version:
Component: Menus Keywords: needs-patch
Focuses: Cc:

Description


Attachments (2)

auto_add_pages.diff (3.8 KB) - added by nacin 14 years ago.
auto-add-publish-bottom.diff (2.3 KB) - added by nacin 14 years ago.
Add post_status to wp_update_nav_menu_item, allowing us to directly publish a new menu item. Also, check for draft menu items too when deciding menu order.

Download all attachments as: .zip

Change History (15)

#1 @filosofo
14 years ago

Could you elaborate?

#2 @nacin
14 years ago

(In [14738]) Rename wp_save_nav_menu_item to wp_save_nav_menu_items. Though it could handle one item, it expects a mess of post data containing an array of menu items. see #13447.

#3 @ryan
14 years ago

Add an "Automatically add new pages to this menu" checkbox to each menu tab. When new pages are created, they are added to the end of any menu that has this checked. Also considered was having a dropdown or list of menus in the edit page form, but since adding new pages to a menu is a one time action rather than a state the UX for that would be cumbersome.

#4 @nacin
14 years ago

  • Owner changed from nacin/koopersmith to nacin
  • Status changed from new to accepted

Checkbox is done on my local install. Just need to get the right callback in place on the publish_page hook.

#5 @nacin
14 years ago

  • Keywords has-patch added

#6 @nacin
14 years ago

(In [14878]) Allow pages to be added automattically to menus. see #13447.

#7 @nacin
14 years ago

I'm finding that this reveals a bug (I think) in automatic positioning handled in wp_update_nav_menu_item, but we can iterate. (It adds them to the bottom, but above ones added previously through auto-add.)

#8 @nacin
14 years ago

  • Keywords needs-patch added; has-patch removed

We're also not removing old menus from the auto_add list. We can do that either on save or on the publish hook by doing a get_objects_in_term and intersecting them.

#9 @nacin
14 years ago

(In [14934]) Don't store nonexistent (deleted) menus in the auto-add option. see #13447.

@nacin
14 years ago

Add post_status to wp_update_nav_menu_item, allowing us to directly publish a new menu item. Also, check for draft menu items too when deciding menu order.

#10 @nacin
14 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

(In [14937]) Ensure auto-added pages are both published and sent to the end of the menu. Tiny enhancement and optimization to wp_update_nav_menu_item come with it. fixes #13447.

#11 @nacin
14 years ago

Thanks to filosofo for helping me review that.

We're going to handle UX for this in #13525, where discussion has already started on the exact placement of the checkbox added here. Thus, resolved as fixed.

#12 @nacin
14 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Forgot about post_parent.

#13 @nacin
14 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [15111]) Ensure we're only auto-adding root pages to menus. fixes #13447.

Note: See TracTickets for help on using tickets.