# extendify/3.1.5/app/Notifications/Admin.php

Extendify, version 3.1.5. 84 lines.

- Page: https://pluginprobe.com/plugins/extendify/3.1.5/code/app/Notifications/Admin.php
- Raw: https://pluginprobe.com/plugins/extendify/3.1.5/raw/app/Notifications/Admin.php
- Modified: 2026-08-20T19:51: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/extendify/3.1.5/code/app/Notifications/Admin.php#L10-L20`.

```php
<?php

/**
 * Admin.
 */

namespace Extendify\Notifications;

defined('ABSPATH') || die('No direct access.');

class Admin
{
    public function __construct()
    {
        \add_action('admin_enqueue_scripts', [$this, 'loadScriptsAndStyles']);
        \add_action('admin_notices', [$this, 'renderMountPoint']);
    }

    /**
     * Adds the banner bundle on eligible admin screens
     *
     * @return void
     */
    public function loadScriptsAndStyles()
    {
        if ($this->container() === '') {
            return;
        }

        Assets::enqueue();
    }

    /**
     * Prints the banner mount node on eligible admin screens
     *
     * @return void
     */
    public function renderMountPoint()
    {
        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Mount escapes
        echo $this->container();
    }

    /**
     * notifications.js wraps a container carrying data-admin-notice in
     * admin-notice spacing.
     *
     * @return string
     */
    private function container()
    {
        $slot = $this->currentSlot();
        return $slot ? Mount::container($slot, ['data-admin-notice']) : '';
    }

    private function currentSlot()
    {
        $screen = \get_current_screen();
        if (!$screen) {
            return null;
        }

        if ($screen->id === 'dashboard') {
            return Slots::ADMIN_DASHBOARD;
        }

        return $this->isExcludedScreen($screen) ? null : Slots::ADMIN_OTHERS;
    }

    private function isExcludedScreen($screen)
    {
        if ($screen->base === 'post') {
            return true;
        }

        $excludedIds = ['site-editor', 'plugins', 'plugin-install', 'plugin-editor'];
        if (in_array($screen->id, $excludedIds, true)) {
            return true;
        }

        return strpos($screen->id, '_page_') !== false;
    }
}

```
