WP Manifestindependent plugin directory
manifest / themes / theme-customizer

Kunoichi Theme Customizer WP Registry grade A. No security issues foundWP RegistryNo security issues foundOpen the reportA

A utility class to integrate WordPress theme customizer API.

★ 1stars
152release downloads
≈10active sites
1.2.1latest · 2 years ago

Install

Download theme-customizer.zip From the 1.2.1 release on GitHub, Apr 25, 2024

Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/kuno1/theme-customizer/releases/download/1.2.1/theme-customizer.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

A handy PHP class to integrate WordPress Theme Customizer.

Installation

composer require kunoichi/theme-customizer

In your theme's functions.php:

require __DIR__ . '/vendor/autoload.php';

How to Implement

This library is an abstract class, so you have to implement it.

<?php

namespace YourNameSpace\Customizer;

use Kunoichi\ThemeCustomizer\CustomizerSetting;

class YourClass extends CustomizerSetting {

    protected $section_id = 'your_custom_setting';

    /**
     * Override this function to register a new section.
     */
    protected function section_setting() {
        return [
            'title'      => __( 'My Theme Setting', 'domain' ),
            'priority'   => 100,
        ];
    }

    /**
     * Return associative array for each fields.
     *
     * @return array
     */
    protected function get_fields(): array {
        return [
            'yoru_serrint_id' => [
                'label'       => __( 'Ad after title', 'domain' ),
                'stored'      => 'option',  // 'option' or 'theme_mod'(default)
                'type'        => 'textarea' // Type of UI.
            ],
        ];
    }
}

And you can call them in your theme's functions.php.

YourNameSpace\Customizer\YourClass::get_instance();

Or, simply scan directory for convenience. Let's suppose that your theme is my-theme and directory is PSR-0 ready like below:

my-theme
└src
  └ MyBrand
     └ MyTheme
        └ Customizers
          ├ ColorSetting
          └ AdSetting

You should call like this:

Kunoichi\ThemeCustomizer::register( 'YourBrand\YourTheme\Customizers' );

Arguments

$namespace

Your PSR-0 name space. Directory will be scan recursively.

$direcotry

If not set, default is get_template_directory() . '/src, which seem to be a common location in theme development.

Predefined Classes

Some customizers are predefined for convenience. See src/Kunoichi\ThemeCustomizer\Pattern.

1. Meta and SEO

Kunoichi\ThemeCutomizer\Pattern\Seo adds HTML meta information like meta-description, OGP, etc.

This customizer is userful to provide basic SEO features. For more advanced features, you should recommmend some plugins.

  • Google Analytics or Google Tag Manager scirpt.
  • Default and Site top OGP image.
  • Top page description.
  • Option to stop all feature(in plugins' favor).

2. Sharing

Kunoichi\ThemeCutomizer\Pattern\Share adds share buttons for SNS. The only codes you should implement:

  • Write code to display share buttons via Kunoichi\ThemeCutomizer\Pattern\Share::render( $position )

Available services are listed in src/Kunoithi/ThemeCustomizer/Models/Brand

Development

wp-env is supported for instant development. You need node, npm, and docker installed.

# Install libraries.
npm install
# Start Container
npm start
# wp-env commands are available via npm.
npm run env stop

License

GPL 3.0 or later.

Releases

24 releases. Each count is every asset in that release; expand a row for the breakdown.

Tag
Published
Assets
Downloads
1.2.1 latest
Apr 25, 2024 2 years ago
theme-customizer.zip
5
Dec 1, 2022 3 years ago
theme-customizer.zip
5
Dec 9, 2020 5 years ago
theme-customizer.zip
8
Sep 23, 2020 6 years ago
theme-customizer.zip
8
Aug 19, 2020 6 years ago
theme-customizer.zip
9
Jun 4, 2020 6 years ago
theme-customizer.zip
10
Jun 4, 2020 6 years ago
theme-customizer.zip
10
May 27, 2020 6 years ago
theme-customizer.zip
3
May 27, 2020 6 years ago
theme-customizer.zip
5
May 26, 2020 6 years ago
theme-customizer.zip
4
May 13, 2020 6 years ago
theme-customizer.zip
4
May 13, 2020 6 years ago
theme-customizer.zip
4
May 7, 2020 6 years ago
theme-customizer.zip
5
May 7, 2020 6 years ago
theme-customizer.zip
4
May 7, 2020 6 years ago
theme-customizer.zip
4
Mar 18, 2020 6 years ago
theme-customizer.zip
4
Nov 28, 2019 6 years ago
theme-customizer.zip
9
Nov 28, 2019 6 years ago
theme-customizer.zip
5
Nov 28, 2019 6 years ago
theme-customizer.zip
6
Nov 28, 2019 6 years ago
theme-customizer.zip
6
Nov 28, 2019 6 years ago
theme-customizer.zip
5
Jul 25, 2019 7 years ago
theme-customizer.zip
12
Jul 25, 2019 7 years ago
theme-customizer.zip
7
Jul 25, 2019 7 years ago
theme-customizer.zip
10

Active-site estimate ≈10 comes from the median of recent superseded releases. Method.

A grade

Security

Kunoichi Theme Customizer 0.0.0 · audited by WP Registry

No security issues found.

Audited release
0.0.0
Findings
none
Worst severity
—
Content hash
5c00461519cfe6ac8344347d…

WP Registry hashes the installable build and reports on that exact bytes-for-bytes copy. Embargoed findings are withheld until they are disclosed, so a clean verdict means nothing public is outstanding. WP Manifest does not audit code itself.