|
1 | 1 | # Notices |
2 | 2 |
|
3 | | -The three notices this library raises — the standalone was deactivated, the standalone is still |
4 | | -active, a dependency check failed — are queued in a single option named |
| 3 | +The notices this library raises — the standalone was deactivated, the standalone is still active, a |
| 4 | +network-active standalone was left active to avoid stranding sites, a dependency check failed — are |
| 5 | +queued in a single option named |
5 | 6 | `{option_prefix}_plugin_absorber_notices`, where `{option_prefix}` is the hook prefix lowercased |
6 | 7 | with hyphens folded to underscores: a hook prefix of `Give-Core` stores |
7 | 8 | `give_core_plugin_absorber_notices`. On multisite it is a **network** option, so the queue is shared |
@@ -29,13 +30,22 @@ the [activation-error screen](conflict-handling.md#reactivating-the-standalone) |
29 | 30 | try to re-activate it. Write one sentence that reads sensibly both as a report of something already |
30 | 31 | done and as the explanation standing in for a fatal-error warning. |
31 | 32 |
|
| 33 | +## The stranding notice |
| 34 | + |
| 35 | +On multisite only, a network-active standalone whose bundled copy ships in a host plugin that is not |
| 36 | +itself network-activated is left active rather than deactivated: turning it off across the network |
| 37 | +would remove it from the sites the host is not active on, where nothing loads the bundled copy. This |
| 38 | +notice explains that, and — unlike the one-time deactivation notice — it recurs until the topology is |
| 39 | +resolved, either by network-activating the host or by removing the standalone from the Network Admin. |
| 40 | +Its text is the `stranding_notice_message` [filter](filters.md); there is no config key for it. |
| 41 | + |
32 | 42 | ## Rendering them yourself |
33 | 43 |
|
34 | 44 | `Absorber::notices()->option_name()` tells you where the queue is kept, so you can render it |
35 | 45 | yourself without replacing anything. The value is an `array<string,string>` keyed `slug:type`, where |
36 | | -the type is `merge`, `conflict` or `dependency` — `give-recurring:merge`, for example. The first |
37 | | -two render as `notice-warning` and the third as `notice-error`, since a dependency notice reports a |
38 | | -plugin that did not load at all. The messages may contain markup; the built-in rendering passes |
| 46 | +the type is `merge`, `conflict`, `stranding` or `dependency` — `give-recurring:merge`, for example. |
| 47 | +The first three render as `notice-warning` and the last as `notice-error`, since a dependency notice |
| 48 | +reports a plugin that did not load at all. The messages may contain markup; the built-in rendering passes |
39 | 49 | them through `wp_kses_post()`, so a link, emphasis or a list survives while scripts and event |
40 | 50 | handlers are stripped. Paragraphs come from `wpautop()`, so send the message unwrapped and let a |
41 | 51 | blank line break it — a `<p>` of your own is left as it is rather than nested inside another. |
|
0 commit comments