Repository navigation
Commit ea7911b
committed
fix(purge): harden missing-option fallback against filtered defaults
Settings::get_defaults() runs every field through wp_stream_settings_option_fields,
which Network::get_network_admin_fields() uses to strip 'records_ttl' from the
per-site option's defaults set. Outside any admin context (Action Scheduler,
WP-CLI, system cron) the per-site option_key is in effect, so the filtered
defaults never contained general_records_ttl. Without this fallback the
auto-purge silently no-ops on every install where the option is missing,
defeating the whole point of fixing this on bloated sites.
Hardcoded fallback to 30 days (the documented default on the settings field
itself) when general_records_ttl is absent after the merge.
Caught by section 9 of the e2e plan.
Refs XWPENG-281 parent 185fab8 commit ea7911b
1 file changed
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
927 | 927 | | |
928 | 928 | | |
929 | 929 | | |
930 | | - | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
931 | 946 | | |
932 | 947 | | |
933 | 948 | | |
| |||
0 commit comments