Repository navigation
v1.0.0
A rewrite of the plugin for current WordPress, on the WP Bones framework. If you are updating from 0.x, read this.
What stays
- The template tag
wp_chooseyourtheme()and its modesmenu,listandroll, with the same CSS classes (wpcyt_combo,wpcyt_list,wpcyt_roll, the theme name on each list item,selectedon the current one) - Appearance › WP Choose Your Theme is still where you configure it
- Your settings, if 0.x stored them: every theme you had not hidden becomes an allowed theme the first time 1.0 loads. A site without stored 0.x settings is treated as a new installation
What changed
- Requires WordPress 6.6 and PHP 8.1 (0.x did not work on PHP 8: its classes used PHP 4 constructors, which PHP 8 no longer calls, and it relied on
get_themes()andget_current_theme(), deprecated since WordPress 3.4) - New: the choice is stored by theme folder name, in a cookie with
SameSite=LaxandHttpOnly, instead of by theme name in a cookie written by JavaScript. Visitors choose again once: 0.x cookies are not read - New: a theme is applied only if it is allowed, installed and without errors; the active theme is used otherwise. Child themes are applied with their parent
- New: it applies on the public site only, never in wp-admin, the REST API, Ajax, cron, the login screen, the Customizer or theme previews
- New: block themes and classic themes are not mixed: only themes of the same kind as the active one are offered
- New: the choice works without JavaScript, with a link or a form that redirects back to the same page; the dropdown submits itself when JavaScript is on
- New: the shortcode
[wp_chooseyourtheme mode="menu|list|roll"]and a classic widget - New: you set how many days the choice is remembered (30 by default)
- New: pages for visitors who made a choice are sent with
no-cacheandVary: Cookie, so a page cache does not mix visitors up - Changed: you now list the themes that are allowed, not the ones that are hidden. A new installation allows no theme but the active one
- Changed: the settings are saved with a nonce and the
manage_optionscapability, and every value is validated - Changed: every string is translatable; Italian, Spanish, French, German and Brazilian Portuguese are included
- Changed: the plugin removes its options when you delete it
- Removed: the
randmode, which 0.x listed as a future idea and never implemented