Migration V0 18 2


Football Leagues 0.18.2 merges all three settings systems into one page. The core Settings page, the premium Configurator page, and the Appearance > Customize > Football Leagues panel are now a single Football Leagues > Settings screen. As part of that, the values that used to live in the Customizer moved to new storage. This page is for developers who maintain theme template overrides or custom code that reads those display values directly.

Who should read this

You only need this page if you have custom code that reads Customizer display values – either through the accessor (anwp_fl()->customizer->get_value(), AnWPFL_Customizer::get_static_value(), get_customizer_css()) or by reading the raw option (get_option('anwp-fl-customizer')). Both keep working with no changes. Standard installs and overrides that don’t touch Customizer data need nothing.

🎯 What changed

  • One settings page. Settings, the premium Configurator, and the Customizer panel are merged into Football Leagues > Settings. The Configurator submenu item and the Appearance > Customize “Football Leagues” panel are gone. Old bookmarks to either page redirect to the new Settings page.
  • Display values moved. The ~77 keys that lived in the anwp-fl-customizer option moved into two new options: core-origin keys to anwp_fl_display, premium-origin keys (formations, player-stats columns, xG, player header) to anwp_fl_display_pro. Both are JSON, stored nested as [section][key] with the real key names.
  • Settings and Configurator storage is unchanged. anwp_football_leagues_options and anwp_football_leagues_premium_options keep their keys byte-for-byte, so AnWPFL_Options::get_value() and AnWPFL_Premium_Options::get_value() behave exactly as before. Only the Customizer half moved.

Nothing to change for the common case

The Customizer accessor is now a bridge that reads the new options under the hood, but its signature and return values are unchanged. A template override that calls anwp_fl()->customizer->get_value( 'club', 'default_home_color', '#0085ba' ) and is never touched keeps rendering identical output. You move to the new keys on your own schedule – nothing is forced.

Stable public API (no changes needed)

These keep the same signatures and return the same values. They are now thin bridges over the new display options, and they stay as the supported public API:

  • anwp_fl()->customizer->get_value( $section, $key, $default ) – reads a single display value. Resolves core vs premium origin internally.
  • AnWPFL_Customizer::get_static_value( $section, $key, $default ) – the static form, same behavior.
  • anwp_fl()->customizer->get_customizer_css() – the generated inline CSS (colors, font sizes, slim-list width), now built from the new options.

Section names are un-prefixed

The storage section is the bare name – club, match, match_list, standing, player, squad, competition, stadium, general, player_header, colors, font_sizes, advanced_cssnot the fl_* ids you saw in the Customizer UI. Always pass the un-prefixed name (get_value( 'club', ... )), the same way the accessor always took it.

Reading the new options directly (optional)

If you’d rather read the new storage directly instead of going through the Customizer bridge, use the display accessors. Core-origin keys come from anwp_fl()->display; premium-origin keys from anwp_fl_pro()->display. Both expose get_value( string $section, string $key, $default = '' ).

Old patternNew pattern
anwp_fl()->customizer->get_value( 'colors', 'bg-light' )anwp_fl()->display->get_value( 'colors', 'bg-light' ) (core-origin)
anwp_fl()->customizer->get_value( 'club', 'default_home_color', '#0085ba' )anwp_fl()->display->get_value( 'club', 'default_home_color', '#0085ba' )
anwp_fl()->customizer->get_value( 'match', 'formation_show_rating' )anwp_fl_pro()->display->get_value( 'match', 'formation_show_rating' ) (premium-origin)
anwp_fl()->customizer->get_value( 'player_header', 'player_header_elements' )anwp_fl_pro()->display->get_value( 'player_header', 'player_header_elements' )

The colors, font_sizes, and most layout sections are core-origin (anwp_fl()->display). The premium-only keys – the player_header section, plus formation / player-stats / xG keys inside match, arrows / home-away inside standing, and rating colors inside general – are premium-origin (anwp_fl_pro()->display). When in doubt, keep using anwp_fl()->customizer->get_value(), which routes to the right one for you.

The slim-list footer is one array. match_slim_bottom_line stores as a whole array under [match_list][match_slim_bottom_line] (keys like stadium, referee). The accessor still understands the bracket form get_value( 'match_list', 'match_slim_bottom_line[stadium]' ) and indexes into the array for you, so templates that build the leaf at runtime keep working.

Direct option readers stay fresh

Some themes bypass the accessor and read the raw option: get_option( 'anwp-fl-customizer' )['general']['flags']. That keeps returning current values after the migration. The plugin registers an option_anwp-fl-customizer read filter that rebuilds the legacy nested array from the new display options on the fly, so a raw read sees edits made on the new Settings page – even after the raw row is eventually dropped in a future release. No action needed.

Migration timeline

The copy runs once, automatically, when the database upgrade routine advances (core DB version 51, premium DB version 27) on the first admin page load after updating. It is a copy, not a move: the raw anwp-fl-customizer option is left in place and readable, and the routine is idempotent and never overwrites a value already present in the new options. You don’t have to do anything to trigger it.

The legacy anwp-fl-customizer row stays readable until a future release (around 0.20.0) drops it. Even then, the synthesis filter above keeps get_option('anwp-fl-customizer') returning values rebuilt from the new storage, so direct readers don’t break.

Deprecations

  • The Customizer panel registration is retired. AnWPFL_Customizer::register_customizer_settings() (core and premium) no longer runs on normal installs, so there is no “Football Leagues” panel under Appearance > Customize. The read accessors above are unaffected.
  • The legacy CMB2 Settings and Configurator pages are unreachable by default. Their registration is gated behind a developer-only constant – add define( 'ANWPFL_LEGACY_SETTINGS', true ); to wp-config.php only if a third-party integration genuinely needs the old CMB2 metabox. This is a temporary escape hatch and will be removed in a later release.
  • Old page URLs redirect. ?page=anwp_football_leagues_options (old Settings) and ?page=anwp_football_leagues_premium_options (Configurator) issue a temporary (302) redirect to the new Settings page.

πŸ“š Related

  • Migration: v0.18.0 – the postmeta-to-custom-table move for clubs, standings, and competitions.