WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#15470 closed enhancement (worksforme)

Allow default links to be filtered when creating a new site

Reported by: caesarsgrunt Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.1
Component: Multisite Keywords: has-patch
Focuses: Cc:

Description

Most networks don't want the WP default links to be created for every new site.

It would be nice if there was a filter on the $default_links array.

At the moment one has to hook on wpmu_new_blog and remove the links after they have been created. Better to be able to prevent creation of them in the first place, or pass different ones.

If a filter is approved, I can knock up a patch straight away; it will be very simple.

Attachments (1)

15470.diff (554 bytes) - added by caesarsgrunt 5 years ago.

Download all attachments as: .zip

Change History (8)

@caesarsgrunt5 years ago

comment:1 @caesarsgrunt5 years ago

  • Keywords has-patch added

comment:2 follow-up: @westi5 years ago

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

The right thing to do is to use a replacement wp_install_defaults function for this.

comment:3 in reply to: ↑ 2 ; follow-up: @caesarsgrunt5 years ago

Replying to westi:

The right thing to do is to use a replacement wp_install_defaults function for this.

Why make people replace all that functionality when a simple filter would do?

comment:4 in reply to: ↑ 3 ; follow-up: @westi5 years ago

Replying to caesarsgrunt:

Replying to westi:

The right thing to do is to use a replacement wp_install_defaults function for this.

Why make people replace all that functionality when a simple filter would do?

Because if you want to customise it then you likely want to customise all of it.

And filtering the lot is just pointless.

This is one of the pluggable functions which you replace rather than filter the functionality of.

comment:5 in reply to: ↑ 4 @caesarsgrunt5 years ago

Replying to westi:
Yeah, but the rest is (mostly) customisable using options in the Network Admin UI.

Anyway, point taken I guess. It's not that much of a hardship to replace the whole function. :-)

comment:6 follow-up: @westi5 years ago

Those ui options should probably die.

They are an I18N nightmare - storing strings for this in the db doesn't make it easy

comment:7 in reply to: ↑ 6 @caesarsgrunt5 years ago

Replying to westi:

Those ui options should probably die.

They are an I18N nightmare - storing strings for this in the db doesn't make it easy

Yeah, that might be a better way to go. Use a replacement wp_install_defaults for everything.

Note: See TracTickets for help on using tickets.