# fluent-support/1.10.5/app/Hooks/Handlers/ShortcodeHandler.php

Fluent Support – Helpdesk &amp; Customer Support Ticket System, version 1.10.5. 45 lines.

- Page: https://pluginprobe.com/plugins/fluent-support/1.10.5/code/app/Hooks/Handlers/ShortcodeHandler.php
- Raw: https://pluginprobe.com/plugins/fluent-support/1.10.5/raw/app/Hooks/Handlers/ShortcodeHandler.php
- Modified: 2023-10-31T12:32:40+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluent-support/1.10.5/code/app/Hooks/Handlers/ShortcodeHandler.php#L10-L20`.

```php
<?php

namespace FluentSupport\App\Hooks\Handlers;

class ShortcodeHandler
{
    public function fluentSupportPortal($args)
    {
        if(isset($args['attributes'])) {
            $args['attributes'] = json_decode($args['attributes'], true);
        }

        $args = shortcode_atts( array(
            'show_logout' => 'no',
            'business_box_id' => $args['business_box_id'] ?? null,
            'attributes' => [],
        ), $args );

        if ($args['attributes']) {
            add_filter('fluent_support/customer_portal_vars', function ($vars) use($args) {

                $vars['attributes'] = $args['attributes'];
                return $vars;
            });
        }

        if($args['show_logout'] == 'yes') {
            add_filter('fluent_support/customer_portal_vars', function ($vars) {

                $vars['show_logout'] = true;
                return $vars;
            });
        }

        if($args['business_box_id']) {
            add_filter('fluent_support/customer_portal_vars', function ($vars) use($args) {
                $vars['mailbox_id'] = wp_strip_all_tags($args['business_box_id']);
                return $vars;
            });
        }

        return (new CustomerPortalHandler)->renderPortal($args);
    }
}

```
