PHPackages                             typisttech/wp-admin-tabs - 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. typisttech/wp-admin-tabs

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

typisttech/wp-admin-tabs
========================

Create tabbed navigation for WordPress admin dashboard, the OOP way

0.3.1(8y ago)1712.5k3[2 issues](https://github.com/typisttech/wp-admin-tabs/issues)GPL-2.0+PHPPHP &gt;7.0

Since Oct 20Pushed 8y ago2 watchersCompare

[ Source](https://github.com/typisttech/wp-admin-tabs)[ Packagist](https://packagist.org/packages/typisttech/wp-admin-tabs)[ Docs](https://www.typist.tech/projects/wp-admin-tabs)[ RSS](/packages/typisttech-wp-admin-tabs/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (5)Used By (0)

WP Admin Tabs
=============

[](#wp-admin-tabs)

[![Latest Stable Version](https://camo.githubusercontent.com/4bbd1cf9deaef29819136ea352556a001ad0616a84c9dd1050f4a8e89b5dad7b/68747470733a2f2f706f7365722e707567782e6f72672f747970697374746563682f77702d61646d696e2d746162732f762f737461626c65)](https://packagist.org/packages/typisttech/wp-admin-tabs)[![Total Downloads](https://camo.githubusercontent.com/0272aefe224761957b4c419339bce09563b6f80ff4532ec0e7368eeb456508d4/68747470733a2f2f706f7365722e707567782e6f72672f747970697374746563682f77702d61646d696e2d746162732f646f776e6c6f616473)](https://packagist.org/packages/typisttech/wp-admin-tabs)[![Build Status](https://camo.githubusercontent.com/9d5ba3f478c773a1a8cf47cdbd200dc8312dafbb5fc1fdddbf8baa457bb62645/68747470733a2f2f7472617669732d63692e6f72672f547970697374546563682f77702d61646d696e2d746162732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/TypistTech/wp-admin-tabs)[![codecov](https://camo.githubusercontent.com/69b4e9e7403238033e64a80094713688d700473f463b5cf22977ec603aef3d13/68747470733a2f2f636f6465636f762e696f2f67682f547970697374546563682f77702d61646d696e2d746162732f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/TypistTech/wp-admin-tabs)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/cec372f981a7dfbcd8391dcfd8b53c6daf56b9e16c428dadd2a8d7910c44e35f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f547970697374546563682f77702d61646d696e2d746162732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/TypistTech/wp-admin-tabs/?branch=master)[![PHP Versions Tested](https://camo.githubusercontent.com/b90eff0791efa67eb6be8ce0f93cd896cb161f9ae67dbd0aa5e40ea439c76cb9/687474703a2f2f7068702d6579652e636f6d2f62616467652f747970697374746563682f77702d61646d696e2d746162732f7465737465642e737667)](https://travis-ci.org/TypistTech/wp-admin-tabs)[![StyleCI](https://camo.githubusercontent.com/b19c2acc9a7cb20560448bbda9a9a8a81049254786d0da82f9c51a7b65502240/68747470733a2f2f7374796c6563692e696f2f7265706f732f3130373438303036342f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/107480064)[![License](https://camo.githubusercontent.com/5d815dbbe6c0dbebf9ecaf88574236ef6233cb04cb869d4bd2569b39804de688/68747470733a2f2f706f7365722e707567782e6f72672f747970697374746563682f77702d61646d696e2d746162732f6c6963656e7365)](https://packagist.org/packages/typisttech/wp-admin-tabs)[![Donate via PayPal](https://camo.githubusercontent.com/b57c445af971e3e99c2d0ccdbf4fa7faa4358ba27fecc8f68459b30289f82eda/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d50617950616c2d626c75652e737667)](https://typist.tech/donate/wp-admin-tabs/)[![Hire Typist Tech](https://camo.githubusercontent.com/e392a964bbdc0c32d95825bbc8253027387bcb9b021176d807d22ac75d86f308/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f486972652d547970697374253230546563682d6666363962342e737667)](https://typist.tech/contact/)

Create tabbed navigation for WordPress admin dashboard, the OOP way.

- [Install](#install)
- [Usage](#usage)
    - [Example](#example)
    - [AdminTab](#admintab)
        - [`__construct(string $menuTitle, string $url)`](#__constructstring-menutitle-string-url)
    - [AdminTabCollection](#admintabcollection)
        - [`add(AdminTab ...$adminTabs)`](#addadmintab-admintabs)
        - [`render()`](#render)
        - [`toHtml(): string`](#tohtml-string)
- [Frequently Asked Questions](#frequently-asked-questions)
    - [Is this a plugin?](#is-this-a-plugin)
    - [What to do when wp.org plugin team tell me to clean up the `vendor` folder?](#what-to-do-when-wporg-plugin-team-tell-me-to-clean-up-the-vendor-folder)
    - [Can two different plugins use this package at the same time?](#can-two-different-plugins-use-this-package-at-the-same-time)
    - [Do you have real life examples that use this package?](#do-you-have-real-life-examples-that-use-this-package)
    - [It looks awesome. Where can I find some more goodies like this?](#it-looks-awesome-where-can-i-find-some-more-goodies-like-this)
- [Support](#support)
    - [Why don't you hire me?](#why-dont-you-hire-me)
    - [Want to help in other way? Want to be a sponsor?](#want-to-help-in-other-way-want-to-be-a-sponsor)
- [Developing](#developing)
- [Running the Tests](#running-the-tests)
- [Feedback](#feedback)
- [Change log](#change-log)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

Install
-------

[](#install)

Installation should be done via composer, details of how to install composer can be found at .

```
$ composer require typisttech/wp-admin-tabs
```

You should put all `WP Admin Tabs` classes under your own namespace to avoid class name conflicts.

- [imposter-plugin](https://github.com/Typisttech/imposter-plugin)
- [mozart](https://github.com/coenjacobs/mozart)

Usage
-----

[](#usage)

### Example

[](#example)

[![Screenshot example](./assets/screenshot-example.png)](./assets/screenshot-example.png)

```
$adminTabCollection = new AdminTabCollection();
$adminTabCollection->add(
    new AdminTab('Blog', 'https://typist.tech'),
    new AdminTab('Plugins', admin_url('plugins.php')),
    new AdminTab('Users', admin_url('users.php')),
    new AdminTab('Tab A', admin_url('users.php')),
    new AdminTab('Tab B', admin_url('users.php')),
);

// This echos the tabs:
$adminTabCollection->render();

// This returns the HTML string of the tabs:
$html = $adminTabCollection->toHtml();
```

### AdminTab

[](#admintab)

#### `__construct(string $menuTitle, string $url)`

[](#__constructstring-menutitle-string-url)

`AdminTab` constructor.

- @param string $menuTitle The menu title of this tab.
- @param string $url The url of this tab.

```
new AdminTab('Blog', 'https://typist.tech');

new AdminTab('Blog', admin_url('plugins.php'));
```

### AdminTabCollection

[](#admintabcollection)

#### `add(AdminTab ...$adminTabs)`

[](#addadmintab-admintabs)

Add admin tabs.

- @param AdminTab\[\] ...$adminTabs Admin tabs to be added.

```
$adminTabCollection = new AdminTabCollection();

// Add single admin tab.
$adminTabCollection->add(
    new AdminTab('Users', admin_url('users.php'))
);

// Add multiple admin tabs.
$adminTabCollection->add(
    new AdminTab('Blog', 'https://typist.tech'),
    new AdminTab('Plugins', admin_url('plugins.php'))
);
```

#### `render()`

[](#render)

Render the tabs with `echo`.

```
$adminTabCollection = new AdminTabCollection();
$adminTabCollection->add(
    new AdminTab('Blog', 'https://typist.tech'),
    new AdminTab('Plugins', admin_url('plugins.php')),
    new AdminTab('Users', admin_url('users.php'))
);

$adminTabCollection->render();
```

#### `toHtml(): string`

[](#tohtml-string)

Converts the tabs to HTML string without `echo`.

```
$adminTabCollection = new AdminTabCollection();
$adminTabCollection->add(
    new AdminTab('Blog', 'https://typist.tech'),
    new AdminTab('Plugins', admin_url('plugins.php')),
    new AdminTab('Users', admin_url('users.php'))
);

$adminTabCollection->toHtml();
```

Frequently Asked Questions
--------------------------

[](#frequently-asked-questions)

### Is this a plugin?

[](#is-this-a-plugin)

No, this is a package that should be part of your plugin.

### What to do when wp.org plugin team tell me to clean up the `vendor` folder?

[](#what-to-do-when-wporg-plugin-team-tell-me-to-clean-up-the-vendor-folder)

Re-install packages via the following command. This package exports only necessary files to `dist`.

```
$ composer install --no-dev --prefer-dist --optimize-autoloader
```

### Can two different plugins use this package at the same time?

[](#can-two-different-plugins-use-this-package-at-the-same-time)

Yes, if put all `WP Admin Tabs` classes under your own namespace to avoid class name conflicts.

- [imposter-plugin](https://github.com/Typisttech/imposter-plugin)
- [mozart](https://github.com/coenjacobs/mozart)

### Do you have real life examples that use this package?

[](#do-you-have-real-life-examples-that-use-this-package)

Here you go:

- [Sunny](https://github.com/Typisttech/sunny)
- [WP Cloudflare Guard](https://github.com/TypistTech/wp-cloudflare-guard)
- [WP Better Settings](https://github.com/TypistTech/wp-better-settings)
- [WP Tabbed Admin Pages](https://github.com/TypistTech/wp-tabbed-admin-pages)

*Add your own plugin [here](https://github.com/TypistTech/wp-admin-tabs/edit/master/README.md)*

### It looks awesome. Where can I find some more goodies like this?

[](#it-looks-awesome-where-can-i-find-some-more-goodies-like-this)

- Articles on Typist Tech's [blog](https://typist.tech)
- [Tang Rufus' WordPress plugins](https://profiles.wordpress.org/tangrufus#content-plugins) on wp.org
- More projects on [Typist Tech's GitHub profile](https://github.com/TypistTech)
- Stay tuned on [Typist Tech's newsletter](https://typist.tech/go/newsletter)
- Follow [Tang Rufus' Twitter account](https://twitter.com/TangRufus)
- Hire [Tang Rufus](https://typist.tech/contact) to build your next awesome site

Support
-------

[](#support)

Love `wp-admin-tabs`? Help me maintain it, a [donation here](https://typist.tech/donation/) can help with it.

### Why don't you hire me?

[](#why-dont-you-hire-me)

Ready to take freelance WordPress jobs. Contact me via the contact form [here](https://typist.tech/contact/) or, via email

### Want to help in other way? Want to be a sponsor?

[](#want-to-help-in-other-way-want-to-be-a-sponsor)

Contact: [Tang Rufus](mailto:tangrufus@gmail.com)

Developing
----------

[](#developing)

To setup a developer workable version you should run these commands:

```
$ composer create-project --keep-vcs --no-install typisttech/wp-admin-tabs:dev-master
$ cd wp-admin-tabs
$ composer install
```

Running the Tests
-----------------

[](#running-the-tests)

[WP Admin Tabs](https://github.com/TypistTech/wp-admin-tabs) run tests on [Codeception](http://codeception.com/) and relies [wp-browser](https://github.com/lucatume/wp-browser) to provide WordPress integration. Before testing, you have to install WordPress locally and add a [codeception.yml](http://codeception.com/docs/reference/Configuration) file. See [\*.suite.example.yml](./tests/) for [Local by Flywheel](https://share.getf.ly/v20q1y) configuration examples.

Actually run the tests:

```
$ composer test
```

We also test all PHP files against [PSR-2: Coding Style Guide](http://www.php-fig.org/psr/psr-2/) and part of the [WordPress coding standard](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards).

Check the code style with `$ composer check-style`.

Feedback
--------

[](#feedback)

**Please provide feedback!** We want to make this package useful in as many projects as possible. Please submit an [issue](https://github.com/TypistTech/wp-admin-tabs/issues/new) and point out what you do and don't like, or fork the project and make suggestions. **No issue is too small.**

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](./CODE_OF_CONDUCT.md) for details.

Credits
-------

[](#credits)

[WP Admin Tabs](https://github.com/TypistTech/wp-admin-tabs) is a [Typist Tech](https://typist.tech) project and maintained by [Tang Rufus](https://twitter.com/Tangrufus), freelance developer for [hire](https://typist.tech/contact/).

Full list of contributors can be found [here](https://github.com/TypistTech/wp-admin-tabs/graphs/contributors).

License
-------

[](#license)

[WP Admin Tabs](https://github.com/TypistTech/wp-admin-tabs) is licensed under the GPLv2 (or later) from the [Free Software Foundation](http://www.fsf.org/). Please see [License File](LICENSE) for more information.

###  Health Score

30

—

LowBetter than 65% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity51

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 ~3 days

Total

4

Last Release

3114d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c1b05c8ed4ea3f68173555264d0226d5faeb7f315ed9df91890c351ef576ce72?d=identicon)[TangRufus](/maintainers/TangRufus)

---

Top Contributors

[![tangrufus](https://avatars.githubusercontent.com/u/2259834?v=4)](https://github.com/tangrufus "tangrufus (41 commits)")

---

Tags

wordpresswordpress-developmentwordpress-php-librarywordpresswp

### Embed Badge

![Health badge](/badges/typisttech-wp-admin-tabs/health.svg)

```
[![Health](https://phpackages.com/badges/typisttech-wp-admin-tabs/health.svg)](https://phpackages.com/packages/typisttech-wp-admin-tabs)
```

###  Alternatives

[typisttech/wp-better-settings

A simplified OOP implementation of the WP Settings API

1634.8k1](/packages/typisttech-wp-better-settings)[justcoded/wordpress-theme-boilerplate

WordPress theme boilerplate with better code structure and OOP support.

563.9k1](/packages/justcoded-wordpress-theme-boilerplate)[balbuf/composer-wp

Manage WordPress core, plugins, and themes with composer.

173.6k](/packages/balbuf-composer-wp)[typisttech/wp-admin-notices

A simplified OOP implementation of the WordPress admin notices

141.2k](/packages/typisttech-wp-admin-notices)

PHPackages © 2026

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