PHPackages                             wptrt/customize-section-button - 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. wptrt/customize-section-button

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

wptrt/customize-section-button
==============================

A button section for the WordPress customizer.

1.0.1(6y ago)24471[2 issues](https://github.com/WPTT/customize-section-button/issues)[20 PRs](https://github.com/WPTT/customize-section-button/pulls)GPL-2.0-or-laterPHPPHP &gt;=5.6

Since Jul 1Pushed 3y ago3 watchersCompare

[ Source](https://github.com/WPTT/customize-section-button)[ Packagist](https://packagist.org/packages/wptrt/customize-section-button)[ Docs](https://github.com/WPTRT/customize-section-button)[ RSS](/packages/wptrt-customize-section-button/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (23)Used By (0)

WPTRT Customize Section Button
==============================

[](#wptrt-customize-section-button)

This is a custom section class for the WordPress customizer, which allows theme authors to build a section that has a "button." Its primary purpose is for providing a standardized method of creating a "pro" or "upsell" section in the customizer. However, it can technically be used to link to anywhere.

Usage
-----

[](#usage)

The following code should be integrated within your theme's existing customizer code.

```
// Use statements must come after the `namespace` statement at the top of the
// file but before any other code.

use WPTRT\Customize\Section\Button;

// Register the "button" section.

add_action( 'customize_register', function( $manager ) {

	$manager->register_section_type( Button::class );

	$manager->add_section(
		new Button( $manager, 'themeslug_pro', [
			'title'       => __( 'ThemeName Pro', 'themeslug' ),
			'button_text' => __( 'Go Pro',        'themeslug' ),
			'button_url'  => 'http://example.com'
		] )
	);

} );
```

### Arguments

[](#arguments)

The `Button` section accepts all the same arguments as a normal `WP_Customize_Section`. However, two additional arguments have been added.

- `'button_text'` - The text to display for the section button. Defaults to the active theme name.
- `'button_url'` - The URL to use for the section button. Falls back to the `Theme URI` or the `Author URI`.

### Loading Required CSS and JS

[](#loading-required-css-and-js)

Both the development and production versions of the CSS and JS files are available.

To avoid loading additional resources, we encourage theme authors to import the following files into their own build processes for their customize CSS and JS:

- `/path/to/customize-section-button/resources/js/customize-controls.js`
- `/path/to/customize-section-button/resources/scss/customize-controls.scss`.

However, if you decide to enqueue the production assets directly, integrate the following into your customizer code.

```
// Load the JS and CSS.

add_action( 'customize_controls_enqueue_scripts', function() {

	$version = wp_get_theme()->get( 'Version' );

	wp_enqueue_script(
		'wptrt-customize-section-button',
		get_theme_file_uri( 'path/to/customize-section-button/public/js/customize-controls.js' ),
		[ 'customize-controls' ],
		$version,
		true
	);

	wp_enqueue_style(
		'wptrt-customize-section-button',
		get_theme_file_uri( 'path/to/customize-section-button/public/css/customize-controls.css' ),
		[ 'customize-controls' ],
 		$version
	);

} );
```

Autoloading
-----------

[](#autoloading)

You'll need to use an autoloader with this. Ideally, this would be [Composer](https://getcomposer.org). However, we have a [basic autoloader](https://github.com/WPTRT/autoload) available to include with themes if needed.

### Composer

[](#composer)

From the command line:

```
composer require wptrt/customize-section-button
```

### WPTRT Autoloader

[](#wptrt-autoloader)

If using the WPTRT autoloader, use the following code:

```
include get_theme_file_path( 'path/to/autoload/src/Loader.php' );

$loader = new \WPTRT\Autoload\Loader();

$loader->add( 'WPTRT\\Customize\\Section', get_theme_file_path( 'path/to/customize-section-button/src' ) );

$loader->register();
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 57.1% 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

2509d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2bbf5d68008a40dd09df7de61b7f06de29163885ca93e8b9706574aadc07ff12?d=identicon)[dingo-d](/maintainers/dingo-d)

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

---

Top Contributors

[![justintadlock](https://avatars.githubusercontent.com/u/1816309?v=4)](https://github.com/justintadlock "justintadlock (20 commits)")[![pattonwebz](https://avatars.githubusercontent.com/u/3902039?v=4)](https://github.com/pattonwebz "pattonwebz (8 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")[![aristath](https://avatars.githubusercontent.com/u/588688?v=4)](https://github.com/aristath "aristath (2 commits)")[![webmandesign](https://avatars.githubusercontent.com/u/2456735?v=4)](https://github.com/webmandesign "webmandesign (1 commits)")

---

Tags

wordpress

### Embed Badge

![Health badge](/badges/wptrt-customize-section-button/health.svg)

```
[![Health](https://phpackages.com/badges/wptrt-customize-section-button/health.svg)](https://phpackages.com/packages/wptrt-customize-section-button)
```

###  Alternatives

[tgmpa/tgm-plugin-activation

TGM Plugin Activation is a PHP library that allows you to easily require or recommend plugins for your WordPress themes (and plugins).

1.8k222.5k13](/packages/tgmpa-tgm-plugin-activation)[aristath/kirki

Extending the WordPress customizer

1.3k73.0k4](/packages/aristath-kirki)[afragen/git-updater

A plugin to automatically update GitHub, Bitbucket, GitLab, or Gitea hosted plugins, themes, and language packs.

3.3k1.6k](/packages/afragen-git-updater)[justintadlock/hybrid-carbon

God-like post featured image script.

202.5k](/packages/justintadlock-hybrid-carbon)[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)
