VaultPress::admin_head PHP Méthode

admin_head() public méthode

public admin_head ( )
    function admin_head()
    {
        if (!current_user_can('manage_options')) {
            return;
        }
        if ($activated = $this->get_option('activated')) {
            if ('network' == $activated) {
                add_action('network_admin_notices', array($this, 'activated_notice'));
            } else {
                foreach (array('user_admin_notices', 'admin_notices') as $filter) {
                    add_action($filter, array($this, 'activated_notice'));
                }
            }
        }
        // ask the user to connect their site w/ VP
        if (!$this->is_registered()) {
            foreach (array('user_admin_notices', 'admin_notices') as $filter) {
                add_action($filter, array($this, 'connect_notice'));
            }
            // if we have an error make sure to let the user know about it
        } else {
            $error_code = $this->get_option('connection_error_code');
            if (!empty($error_code)) {
                foreach (array('user_admin_notices', 'admin_notices') as $filter) {
                    add_action($filter, array($this, 'error_notice'));
                }
            }
        }
    }
VaultPress