# Finspire Creative Role-Based Logo

Finspire Creative Role-Based Logo is a WordPress plugin that displays a different logo depending on the logged-in user's WordPress role.

## Installation

1. Upload the `finspire-creative-role-based-logo` folder to `wp-content/plugins/`.
2. Activate **Finspire Creative Role-Based Logo** in **Plugins**.
3. Go to **Users > Finspire Creative Role-Based Logo**.
4. Copy the shortcode from the shortcode field.
5. Choose a default logo and optional dimensions for each company role.
6. Add `[finspire_role_logo]` anywhere shortcodes are supported.

## Shortcode

Basic usage:

```text
[finspire_role_logo]
```

With options:

```text
[finspire_role_logo size="medium" class="site-company-logo"]
```

The width and height saved on **Users > Finspire Creative Role-Based Logo** are used automatically. You can override them in a specific shortcode:

```text
[finspire_role_logo width="180" height="60"]
```

You can also use CSS units:

```text
[finspire_role_logo width="12rem" height="auto"]
```

Linked logo:

```text
[finspire_role_logo link="https://example.com"]
```

Testing a specific role:

```text
[finspire_role_logo role="company_a"]
```

## Shortcode Attributes

| Attribute | Default | Description |
| --- | --- | --- |
| `size` | `full` | WordPress image size: `thumbnail`, `medium`, `large`, or `full`. |
| `width` | admin setting | Optional image width. Plain numbers are treated as pixels. Also supports `px`, `em`, `rem`, `%`, `vw`, and `vh`. |
| `height` | admin setting | Optional image height. Plain numbers are treated as pixels. Also supports `auto`, `px`, `em`, `rem`, `%`, `vw`, and `vh`. |
| `class` | empty | Adds a CSS class to the image. |
| `alt` | role name + `logo` | Overrides the image alt text. |
| `fallback` | `yes` | Use `fallback="no"` to hide the logo when no role logo is mapped. |
| `role` | current user role | Optional role slug override, useful for testing. |
| `link` | empty | Optional URL to wrap the logo in a link. |

## Notes

- If a user has multiple roles, the plugin uses the first role that has a logo assigned.
- If no assigned role has a logo, the plugin uses the default logo when one is set.
- Logged-out visitors do not see a logo.

## WordPress.org Metadata

- Author: Finspire Creative
- Author URI: https://finspirecreative.com
- Requires at least: WordPress 5.8
- Tested up to: WordPress 6.9
- Requires PHP: 7.4
- License: GPL-2.0-or-later
- Version: 1.3.7
- Support Email: contact@finspirecreative.com
