WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 22 months ago

#24061 closed enhancement (wontfix)

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

Reported by: 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 2 years ago.
24061.2.diff (2.2 KB) - added by jeremyfelt 2 years ago.
24061.3.diff (2.4 KB) - added by jeremyfelt 23 months ago.
24061.4.diff (584 bytes) - added by jeremyfelt 23 months ago.
24061.5.diff (621 bytes) - added by jeremyfelt 23 months ago.

Download all attachments as: .zip

Change History (17)

@johnbillion2 years ago

comment:1 @johnbillion2 years ago

  • Keywords has-patch added

Patch

comment:2 @toscho2 years ago

  • Cc info@… added

@jeremyfelt2 years ago

comment:3 @jeremyfelt2 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

comment:4 @Ipstenu2 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.

comment:5 follow-up: @nacin23 months ago

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

@jeremyfelt23 months ago

comment:6 in reply to: ↑ 5 @jeremyfelt23 months 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.

comment:7 @DrewAPicture23 months ago

  • Keywords needs-docs added

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

@jeremyfelt23 months ago

comment:8 follow-up: @jeremyfelt23 months 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. :)

comment:9 in reply to: ↑ 8 @DrewAPicture23 months 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 23 months ago by DrewAPicture (previous) (diff)

@jeremyfelt23 months ago

comment:10 @jeremyfelt23 months ago

Refreshed docs for the new action in 24061.5.diff.

comment:11 @nacin22 months 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.

comment:12 @nacin22 months 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.