PHPackages                             roots/support - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. roots/support

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

roots/support
=============

v1.0.1(2y ago)02.1M—4%23MITPHPPHP &gt;=5.6

Since Jan 28Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/roots/support)[ Packagist](https://packagist.org/packages/roots/support)[ Docs](https://github.com/roots/support/)[ GitHub Sponsors](https://github.com/roots)[ RSS](/packages/roots-support/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (3)

Support
=======

[](#support)

General-purpose helper functions used across Roots WordPress projects.

[![Packagist Downloads](https://camo.githubusercontent.com/9fa3bcc4dc97a9726bf8a89cbac44ce18d1a93ac47760d39fa747de0481e16c2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726f6f74732f737570706f72743f6c6162656c3d646f776e6c6f61647326636f6c6f72423d32623330373226636f6c6f72413d353235646463267374796c653d666c61742d737175617265)](https://packagist.org/packages/roots/support)[![Follow Roots](https://camo.githubusercontent.com/222256dbdeac58e77f017d847dca30ff4cab027cdf3abfec8e5bfd59de240547/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f666f6c6c6f7725323040726f6f747377702d3164613166323f6c6f676f3d74776974746572266c6f676f436f6c6f723d666666666666266d6573736167653d267374796c653d666c61742d737175617265)](https://twitter.com/rootswp)[![Sponsor Roots](https://camo.githubusercontent.com/31e13361135ff96d01f1eb97157d052029e6f236249996072d8b6bd60b40e9cd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73706f6e736f72253230726f6f74732d3532356464633f6c6f676f3d676974687562267374796c653d666c61742d737175617265266c6f676f436f6c6f723d666666666666266d6573736167653d)](https://github.com/sponsors/roots)

Support us
----------

[](#support-us)

Roots is an independent open source org, supported only by developers like you. Your sponsorship funds [WP Packages](https://wp-packages.org/) and the entire Roots ecosystem, and keeps them independent. Support us by purchasing [Radicle](https://roots.io/radicle/) or [sponsoring us on GitHub](https://github.com/sponsors/roots) — sponsors get access to our private Discord.

Requirements
------------

[](#requirements)

- PHP 5.6+

Installation
------------

[](#installation)

```
composer require roots/support
```

Helpers
-------

[](#helpers)

This package autoloads `helpers.php` and provides:

- `Roots\env($key, $default = null)`
    Laravel-compatible environment lookup.
    Deprecated when `\Illuminate\Support\Env` is available (it delegates there automatically).
- `Roots\value($value)`
    Returns `$value()` if the value is a closure, otherwise returns the value unchanged.
- `Roots\add_filters(iterable $filters, $callback, $priority = 10, $args = 2)`
    Registers one callback across many filter hooks.
- `Roots\remove_filters(iterable $filters, $callback, $priority = 10)`
    Removes one callback across many filter hooks.
- `Roots\add_actions(iterable $actions, $callback, $priority = 10, $args = 2)`
    Alias of `add_filters`.
- `Roots\remove_actions(iterable $actions, $callback, $priority = 10)`
    Alias of `remove_filters`.
- `Roots\wp_die($message, $subtitle = '', $title = '', $footer = '')`
    Wrapper around WordPress `wp_die()` with Roots-flavored defaults.

Usage
-----

[](#usage)

```
