WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 2 years ago

#43770 closed enhancement (invalid)

accept 'menu_order' for 'orderby' get_sites() argument

Reported by: gnowland Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.1
Component: Networks and Sites Keywords:
Focuses: multisite Cc:

Description

Trying to show a list of sites in a multisite network with get_sites(), using 'menu_order' for the 'orderby' argument does not have any effect (sites are instead ordered by id).

Upon further investigation it appears that 'menu_order' is not one of the accepted options for 'orderby' (per codex page for get_sites()).

Plugins like Intuitive Custom Post Order allow re-ordering of sites, and indeed there is a menu_order column in the wp_blogs table with the correct order.

I would like to propose adding 'menu_order' as an accepted option for the 'orderby' argument of get_sites().

Would this be possible?

Change History (5)

#1 @earnjam
3 years ago

There is not a menu_order column on wp_blogs by default. That column is something that the Intuitive Custom Post Order plugin adds.

So unless we modify the db schema, then we can't do this in core. This feels like a niche situation to me and probably best left to plugins to execute.

#2 @soulseekah
3 years ago

Welcome to Trac! Thanks for your report.

I agree with @earnjam. This is indeed something that the plugin should be attending to and not core.

#3 @gnowland
3 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

@earnjam @soulseekah Thank you gentlemen, I had not realized the menu_order column was added by Intuitive Custom Post Order Plugin, and I agree that in this case it would best be handled by that plugin. I will look into what filters are available. Thank you for your time. Cheers!

#4 @soulseekah
3 years ago

  • Resolution changed from wontfix to invalid

#5 @netweb
2 years ago

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