2017 © Pedro Peláez
 

wordpress-plugin toolbar-theme-switcher

Adds WordPress toolbar menu that allows users to switch theme for themselves

image

rarst/toolbar-theme-switcher

Adds WordPress toolbar menu that allows users to switch theme for themselves

  • Sunday, November 27, 2016
  • by Rarst
  • Repository
  • 4 Watchers
  • 16 Stars
  • 940 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 6 Forks
  • 0 Open issues
  • 5 Versions
  • 7 % Grown

The README.md

Toolbar Theme Switcher — for WordPress

Scrutinizer Code Quality, (*1)

Plugin provides toolbar (admin bar) menu to quickly switch between available themes., (*2)

Theme choice is individual for user, saved in cookies and doesn't affect current theme of the site., (*3)

Plugin is multisite-aware — it will only list themes allowed for site and save choice for each site separately., (*4)

Installation

Download plugin archive from releases section., (*5)

Or install in plugin directory via Composer:, (*6)

composer create-project rarst/toolbar-theme-switcher --no-dev

Frequently Asked Questions

I switched to a broken theme!

You can reset via special URL parameter example.com?tts_reset or by clearing browser’s cookies for the site., (*7)

I don't want all themes to show...

Filter tts_allowed_themes and unset unwanted themes., (*8)

Example code (removes Twenty Ten theme from the list):, (*9)

add_filter( 'tts_allowed_themes', 'hide_twenty_ten' );

function hide_twenty_ten( $themes ) {

    unset( $themes['Twenty Ten'] );

    return $themes;
}

Who can see and use the menu?

Users with switch_themes capability (administrators by default)., (*10)

Filter tts_capability (capability name) or tts_can_switch_themes (boolean) to customize., (*11)

I don't want theme name in toolbar? | I want something else in toolbar?

Filter tts_root_title to control what it says., (*12)

I have a lot of themes and it's becoming sluggish...

Plugin needs to build full list of available themes, which isn't typically needed on each page load and can be relatively slow with a lot of disk access., (*13)

When using Object Cache, caching theme data in WordPress can be enabled via:, (*14)

add_filter( 'wp_cache_themes_persistently', '__return_true' );

Since it doesn't handle invalidation (will need to wait or flush cache when themes are added/removed), plugin isn't enabling it and leaves choice up to the user., (*15)

The Versions

27/11 2016

dev-master

9999999-dev https://github.com/Rarst/toolbar-theme-switcher

Adds WordPress toolbar menu that allows users to switch theme for themselves

  Sources   Download

MIT

The Requires

 

wordpress

27/11 2016

1.5

1.5.0.0 https://github.com/Rarst/toolbar-theme-switcher

Adds WordPress toolbar menu that allows users to switch theme for themselves

  Sources   Download

MIT

The Requires

 

wordpress

12/11 2014

1.4

1.4.0.0 https://github.com/Rarst/toolbar-theme-switcher

Adds WordPress toolbar menu that allows users to switch theme for themselves

  Sources   Download

MIT

The Requires

 

wordpress

07/09 2014

1.3

1.3.0.0 https://github.com/Rarst/toolbar-theme-switcher

Adds WordPress toolbar menu that allows users to switch theme for themselves

  Sources   Download

MIT

The Requires

 

wordpress

16/05 2014

1.2.1

1.2.1.0 https://github.com/Rarst/toolbar-theme-switcher

Adds WordPress toolbar menu that allows users to switch theme for themselves

  Sources   Download

MIT

The Requires

 

wordpress