Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#24061 closed enhancement (wontfix)

Introduce blog-archived.php and blog-spam.php

Reported by: johnbillion's profile johnbillion Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Multisite Keywords: has-patch
Focuses: Cc:

Description

When Multisite is active and an archived or spammed site is loaded, WordPress first looks for a file in the content directory called blog-suspended.php and loads it if it's found.

Two problems:

  1. The file name is counter-intuitive because 'suspended' isn't the name of a status that a site can have.
  2. It's not possible to serve a different file for spammed and archived sites.

The upcoming patch introduces support for blog-spam.php and blog-archived.php for sites with the respective status. It will fall back to blog-suspended.php for backwards compatibility.

Attachments (5)

24061.patch (2.2 KB) - added by johnbillion 11 years ago.
24061.2.diff (2.2 KB) - added by jeremyfelt 11 years ago.
24061.3.diff (2.4 KB) - added by jeremyfelt 11 years ago.
24061.4.diff (584 bytes) - added by jeremyfelt 11 years ago.
24061.5.diff (621 bytes) - added by jeremyfelt 11 years ago.

Download all attachments as: .zip

Change History (17)

@johnbillion
11 years ago

#1 @johnbillion
11 years ago

  • Keywords has-patch added

Patch

#2 @toscho
11 years ago

  • Cc info@… added

@jeremyfelt
11 years ago

#3 @jeremyfelt
11 years ago

  • Milestone changed from Awaiting Review to 3.7

24061.2.diff is johnbillion's patch refreshed against trunk. Adds blog-spam.php and blog-archived.php as possible drop in templates.

Moving to 3.7 for discussion

#4 @Ipstenu
11 years ago

Would this be appropriate to loop back to #17164 ? We still have the four options, and only having custom pages for two, when they're all hella confusing. I would think maybe dropping some of the options, if we're not going to make them useful, would make sense.

spam
deactivate
delete

Then we can sort out archive, which acts like an almost delete, later.

#5 follow-up: @nacin
11 years ago

We should really just fire an action before all of this and forget these files exist. :-)

@jeremyfelt
11 years ago

#6 in reply to: ↑ 5 @jeremyfelt
11 years ago

Replying to nacin:

We should really just fire an action before all of this and forget these files exist. :-)

24061.3.diff goes this route. There's already an ms_site_check filter, so I went with ms_site_check_status for the action. Also removed the unused $wpdb global and replaced blog with site where appropriate.

#7 @DrewAPicture
11 years ago

  • Keywords needs-docs added

If we go the action route, we'll need docs for it.

@jeremyfelt
11 years ago

#8 follow-up: @jeremyfelt
11 years ago

  • Keywords needs-docs removed

24061.4.diff introduces the ms_site_check_status action with docs. The new patch avoids the massive green/red caused by my overeager attempts to replace all mentions of blog with site. :)

#9 in reply to: ↑ 8 @DrewAPicture
11 years ago

Replying to jeremyfelt:

24061.4.diff introduces the ms_site_check_status action with docs. The new patch avoids the massive green/red caused by my overeager attempts to replace all mentions of blog with site. :)

  • 'Object' should be lowercase
  • Can you be a little more descriptive than 'Contains site details' or point somewhere that has that information?

For the descriptive route, something like this:

* @param object $site An object containing the site's ___, ____, and ___.

For the @see route, something like this would work (notice no period with the @see):

* @param object $site Contains site details. @see some_function()
Last edited 11 years ago by DrewAPicture (previous) (diff)

@jeremyfelt
11 years ago

#10 @jeremyfelt
11 years ago

Refreshed docs for the new action in 24061.5.diff.

#11 @nacin
11 years ago

I was kind of kidding about the action, but it actually makes a lot of sense.

Also, blog-suspended.php could also be used to "route" users to a custom blog-archived.php or blog-spam.php.

I'm not sure we need to actually introduce any more files here. They just feel really restricting and hacky, and they have "blog-" in the name, and more commonly would be a theme template (for the main site), or something.

#12 @nacin
11 years ago

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

I'll be honest, the existing ms_site_check filter is enough to include and die. It doesn't let you alter the function's return value, but A) neither does the action, and B) the only return value that is valid for this function is true anyway; the alternative is to specifically do something and exit.

Note: See TracTickets for help on using tickets.