• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Extending Dependencies_Public (Adding Notice)

Robust

Well-known member
#1
Hey,

In XenForo_Dependencies_Public, there's this:

Code:
    /**
     * List of notice templates and phrases to load if the specified param is set
     *
     * @var array [param => template/phrase key]
     */
    public $notices = array(
        'showUpgradePendingNotice'    => 'notice_upgrade_pending',
        'showBoardClosedNotice'       => 'notice_board_closed',
        'isAwaitingEmailConfirmation' => 'notice_confirm_email',
        'isEmailBouncing'             => 'notice_email_bounce',
        'showCookieNotice'            => 'notice_cookies'
    );
I want to add one more notice to this. Looking at the code, if I added one more notice here, it'd be loaded as all references to here use a foreach. Not really any template editing either, just creating my new one.

Problem is, I'm not sure how to inject a new field value pair to this array. I know the init_dependencies hook exists, but I'm not sure it'll work in my scenario. Just a normal load_class might?