PHPackages                             marspress/short-code - 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. marspress/short-code

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

marspress/short-code
====================

Utility package to initiate new short codes in WordPress.

1.02(4y ago)04GPL-2.0PHPPHP &gt;=7.4

Since Nov 22Pushed 4y ago2 watchersCompare

[ Source](https://github.com/MARSWorksInc/wordpress-short-codes)[ Packagist](https://packagist.org/packages/marspress/short-code)[ RSS](/packages/marspress-short-code/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (5)Used By (0)

MarsPress ShortCode
===================

[](#marspress-shortcode)

### Installation

[](#installation)

Require the composer package in your composer.json with `marspress/short-code` with minimum `dev-main` OR run `composer require marspress/short-code`

### Usage

[](#usage)

`new \MarsPress\ShortCode\Tag()` takes 4 parameters, 2 required and 2 optional.

- Tag Name (required)(string)
    - The tag name to use inside of WordPress. E.g. `output_user_info` would be used as such: `[output_user_info]`
    - If the tag is already in use, it will not register the tag and output an admin notice to admins regarding the duplicate tag name.
- Callback (required)(callable)
    - A callable method. This can be a Closure function or an array with a class method passed as such: `[ $this, '' ]`(non-static) OR `[ __CLASS__, '' ]`(static)
    - If the callback is not callable, a message will be outputted to admins in place of the short code output.
    - IMPORTANT: your callback will be passed 3 parameters:
        - Attributes (object)
            - This will be the parsed attributes, combining the default attributes and the ones defined in the short code.
        - Content (string)
            - This is content inside the short code tags. This is used when using opening and closing tags such as `[user_logged_in]User can see this![/user_logged_in]`
            - Generally you should also call `do_shortcode` on the content parameter before returning it in case there are more short codes within the content.
        - Tag Name (string)
            - The name of the tag being used.
- Default Attributes (optional)(array)
    - An associative array for the default short code attributes available in your callback after being merged with the user defined ones.
    - Defaults to an empty array.
- Override (boolean)
    - Whether to override existing tag names or not.
    - Defaults to false.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

1637d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/adcbfb731b685a8b219008c6c3673b843a0c9aa66c4b6d2a2c1ab03eef959f08?d=identicon)[martian-jesse](/maintainers/martian-jesse)

---

Top Contributors

[![martian-jesse](https://avatars.githubusercontent.com/u/86261906?v=4)](https://github.com/martian-jesse "martian-jesse (5 commits)")

### Embed Badge

![Health badge](/badges/marspress-short-code/health.svg)

```
[![Health](https://phpackages.com/badges/marspress-short-code/health.svg)](https://phpackages.com/packages/marspress-short-code)
```

###  Alternatives

[spatie/fork

A lightweight solution for running code concurrently in PHP

1.0k2.6M39](/packages/spatie-fork)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
