[wp-trac] [WordPress Trac] #46829: Denote the special pages in Customizer Menu editor

WordPress Trac noreply at wordpress.org
Wed Oct 2 17:13:13 UTC 2019


#46829: Denote the special pages in Customizer Menu editor
-------------------------------------+-------------------------------------
 Reporter:  garrett-eclipse          |       Owner:  garrett-eclipse
     Type:  defect (bug)             |      Status:  accepted
 Priority:  normal                   |   Milestone:  5.3
Component:  Menus                    |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch has-           |     Focuses:  ui, administration,
  screenshots needs-testing          |  privacy
-------------------------------------+-------------------------------------
Changes (by garrett-eclipse):

 * keywords:  has-patch has-screenshots reporter-feedback => has-patch has-
     screenshots needs-testing
 * owner:  audrasjb => garrett-eclipse
 * status:  assigned => accepted


Comment:

 Thanks for the ping @desrosj my goals here was to align with #37782 which
 introduces the `get_post_states` function and prioritizes the 3 important
 pages (Front Page, Posts Page, Privacy Policy Page).

 @audrasjb thank you very much for the initial patch pointed me in the
 right direction there. But I agree we shouldn't be using a custom link
 type for these pages as @desrosj mentioned it can cause 404's on slug
 changes.

 The Customizer approach and the core menu approach are very similar so
 I've migrated most of the code from #37782 into patch
 [https://core.trac.wordpress.org/attachment/ticket/46829/46829.3.diff
 46829.3.diff] which addresses the following;
 1. Introduces the important pages at the top of the list.
 2. Updates the label on important pages on the list and in search to use
 get_post_states and fall page to the post_type singular name.
 3. I found a bug where the `Home` custom page stays even if you have a
 homepage, I've put the same checks as #37782 in both the load and search
 functions so `Home` will only be present if no Front Page is set.
 4. I kept the user-created menu nodes at the top above all so when created
 they don't get lost.
 5. In #37782 there was some code to set special flags on the objects, I
 avoided these as we don't use the objects aside from cloning them into the
 $items[] array so those flags wouldn't be present.
 6. In #37782 there was also a reset if the important pages were all the
 pages, this isn't necessary in the customizer version as the merge will
 end up with the same results with or without it.
 7. In #37782 we made the label bold, attempting this hear didn't have the
 desired effect and caused it to look odd as the title was already bold so
 I didn't carry over that CSS here, how the label weight is now, works much
 nicer IMO.

 Aside form #5 & #6 this is a code re-implementation of the committed
 #37782 and would be nice to have it join it's sister in trunk.

 Please test and review. I feel if we can get another test on this we
 should be good to move into `commit`.
 CC @whyisjake - Flagging you as you committed #37782 so might want to have
 a review here.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46829#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list