Title: 4WP Style Switcher
Author: 4wpdev
Published: <strong>9 ژوئن 2026</strong>
Last modified: 9 ژوئن 2026

---

جستجوی افزونه‌ها

![](https://ps.w.org/4wp-style-switcher/assets/banner-772x250.png?rev=3566286)

![](https://ps.w.org/4wp-style-switcher/assets/icon-256x256.png?rev=3566286)

# 4WP Style Switcher

 توسط [4wpdev](https://profiles.wordpress.org/4wpdev/)

[دانلود](https://downloads.wordpress.org/plugin/4wp-style-switcher.1.0.1.zip)

 * [جزئیات](https://fa.wordpress.org/plugins/4wp-style-switcher/#description)
 * [نقد و بررسی‌ها](https://fa.wordpress.org/plugins/4wp-style-switcher/#reviews)
 *  [نصب](https://fa.wordpress.org/plugins/4wp-style-switcher/#installation)
 * [توسعه](https://fa.wordpress.org/plugins/4wp-style-switcher/#developers)

 [پشتیبانی](https://wordpress.org/support/plugin/4wp-style-switcher/)

## توضیحات

4WP Style Switcher reads **style variations** from the active block theme (`theme.
json` and `/styles/*.json`).

A plugin by [4wp.dev](https://4wp.dev/). **4WP** is our project brand; the letters“
WP” appear only as part of that brand name, not as a reference to WordPress. This
plugin is not affiliated with, endorsed, or sponsored by WordPress.

Source code and releases: [github.com/4wpdev/4wp-style-switcher](https://github.com/4wpdev/4wp-style-switcher)

#### Development

Human-readable PHP source is in the public GitHub repository above. The plugin ZIP
includes `src/` (PSR-4 autoload via `src/Autoload.php` when `vendor/` is absent).
No npm build step — front-end scripts ship as plain JS in `assets/`.

**Live demo (WordPress Playground):** https://playground.wordpress.net/?blueprint-
url=https://raw.githubusercontent.com/4wpdev/4wp-style-switcher/v1.0.0/.wordpress-
org/assets/blueprints/blueprint.json

The demo site **Style Switcher** uses Twenty Twenty-Five: About, Morning, Afternoon,
and Evening pages with per-page styles, A/B light vs dark, a bottom-right visitor
switcher, and Light/Dark in the header and footer menus.

**Page style (editor)** — pick a variation for a page; optionally lock it so visitors
cannot override it.

**Frontend switcher** — visitors choose from allowed variations; the choice is stored
in localStorage and synced to a cookie for server-side rendering.

**Light / Dark (navigation block)** — add the Light/Dark block inside Navigation;
map two variations (sun/moon icons).

**A/B testing** — split new visitors between two variations; daily aggregate stats
monitor the traffic split.

#### Privacy

When the visitor switcher or A/B testing is enabled, the plugin may store the selected
style variation in a browser cookie (`forwp_ss_style`) and in localStorage on the
visitor device. No personal data is sent to third-party services. A/B stats are 
aggregated counts stored in your WordPress database.

### Blocks

This plugin provides 1 block.

 * **Light / Dark** — menu toggle between two mapped theme style variations (sun/
   moon icons).**Hooks (developers)**
 * `forwp_style_switcher_variations` — filter theme variation list.
 * `forwp_style_switcher_ab_assigned` — after A/B cohort assignment.
 * `forwp_style_switcher_analytics_track` — analytics events.
 * `forwp_style_switcher_ab_assignment_enabled` — filter A/B assignment.

## بلوک‌ها

این افزونه 1 بلوک ارائه می‌دهد.

 *   Light / Dark Sun and moon toggle for Light/Dark style variations in the navigation
   menu.

## نصب

 1. Upload and activate the plugin.
 2. Go to **Settings  4WP Style Switcher**.
 3. On **Variations**, check which style variations visitors may use.
 4. Under **General**, set the default variation and optional Light/Dark mapping.
 5. Edit a page  **Page style** panel to assign or lock a variation.
 6. In the site editor, insert **Light / Dark** inside the **Navigation** block.

## سوالات متداول

### Which themes are supported?

Block themes (FSE) that ship style variations under the theme’s `/styles/` directory.

### Where is the Playground demo configured?

In the GitHub repository: `playground/setup.php` and `.wordpress-org/assets/blueprints/
blueprint.json`.

### Does the floating switcher list every theme variation?

It lists variations allowed on the **Variations** settings tab. The menu Light/Dark
block uses only the two variations mapped under **General**.

## نقد و بررسی‌ها

نقد و بررسی‌ای برای این افزونه یافت نشد.

## توسعه دهندگان و همکاران

“4WP Style Switcher” نرم افزار متن باز است. افراد زیر در این افزونه مشارکت کرده‌اند.

مشارکت کنندگان

 *   [ 4wpdev ](https://profiles.wordpress.org/4wpdev/)

[ترجمه “4WP Style Switcher” به زبان شما.](https://translate.wordpress.org/projects/wp-plugins/4wp-style-switcher)

### علاقه‌ مند به توسعه هستید؟

[Browse the code](https://plugins.trac.wordpress.org/browser/4wp-style-switcher/),
check out the [SVN repository](https://plugins.svn.wordpress.org/4wp-style-switcher/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/4wp-style-switcher/)
by [RSS](https://plugins.trac.wordpress.org/log/4wp-style-switcher/?limit=100&mode=stop_on_copy&format=rss).

## گزارش تغییرات

#### 1.0.1

 * Plugin URI: https://4wp.dev/ (GitHub link stays in readme Development section).
 * Removed `FORWP_STYLE_SWITCHER_PLAYGROUND_URL` from plugin PHP; no remote URLs
   in runtime code.

#### 1.0.0

 * First WordPress.org release (1.0.0).
 * Plugin Check: inline script moved to enqueued assets; security and naming fixes.
 * readme.txt: 4WP trademark disclaimer, Development, Blocks, Privacy sections.
 * Playground blueprint and demo links updated for v1.0.0.

#### 0.2.5

 * Request-level caching in Style_Registry, Style_Resolver, and Style_Applicator(
   faster page loads).
 * GitHub README banner; Playground blueprint and demo links updated for v0.2.5.

#### 0.2.4

 * Playground demo pages use theme.json variation titles (single H1 from template,
   slug in content).
 * Morning / Afternoon / Evening / Night pages with matching per-page styles; Afternoon
   locked.
 * Light/Dark menu toggle disabled when page style switching is locked.

#### 0.2.3

 * Per-page style meta, A/B light vs dark, visitor switcher bottom-right, two locked
   demo pages.
 * Shared navigation in header and footer template parts.
 * Fix Documentation tab accordion spacing in admin.

#### 0.2.2

 * Apply visitor style from the query param on the same request (no redirect; works
   in Playground iframe).
 * Clean the style query param from the URL after the page loads.

#### 0.2.1

 * Fix visitor style switching on WordPress Playground (server-side cookie via query
   param).
 * Playground setup resolves variation slugs from the active theme dynamically.
 * Cookie sync uses Secure flag on HTTPS.

#### 0.2.0

 * Style registry and resolver for theme.json variations.
 * Admin settings (General, Variations, A/B Testing) with REST API.
 * Frontend floating switcher with localStorage and cookie sync.
 * Light/Dark Gutenberg block for the Navigation menu.
 * A/B testing with lightweight daily stats table.
 * WordPress Playground blueprint (Morning / Afternoon / Midnight demo).
 * Fixes: empty allowed-variations recovery, A/B REST recursion, partial settings
   save.

#### 0.1.0

 * Initial scaffold.

## اطلاعات

 *  نگارش **1.0.1**
 *  Last updated **1 روز پیش**
 *  نصب‌های فعال **کمتر از 10**
 *  نگارش وردپرس ** 6.4 یا بالاتر **
 *  Tested up to **7.0**
 *  نگارش PHP ** 7.4 یا بالاتر **
 *  زبان
 * [English (US)](https://wordpress.org/plugins/4wp-style-switcher/)
 * Tags
 * [block-theme](https://fa.wordpress.org/plugins/tags/block-theme/)[dark mode](https://fa.wordpress.org/plugins/tags/dark-mode/)
   [full-site-editing](https://fa.wordpress.org/plugins/tags/full-site-editing/)
   [style variations](https://fa.wordpress.org/plugins/tags/style-variations/)[theme.json](https://fa.wordpress.org/plugins/tags/theme-json/)
 *  [نمایش پیشرفته](https://fa.wordpress.org/plugins/4wp-style-switcher/advanced/)

## امتیازها

هنوز هیچ نقدی ارسال نشده است.

[Your review](https://wordpress.org/support/plugin/4wp-style-switcher/reviews/#new-post)

[مشاهده همه بررسی‌ها](https://wordpress.org/support/plugin/4wp-style-switcher/reviews/)

## مشارکت کنندگان

 *   [ 4wpdev ](https://profiles.wordpress.org/4wpdev/)

## پشتیبانی

چیزی برای گفتن دارید؟ نیاز به کمک دارید؟

 [مشاهده انجمن پشتیبانی](https://wordpress.org/support/plugin/4wp-style-switcher/)