PHPackages                             ponponumi/ponponcat\_customize - 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. ponponumi/ponponcat\_customize

ActiveLibrary

ponponumi/ponponcat\_customize
==============================

1.0.1(1y ago)06GPL-2.0-or-laterPHP

Since Dec 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ponponumi/ponponcat_customize)[ Packagist](https://packagist.org/packages/ponponumi/ponponcat_customize)[ RSS](/packages/ponponumi-ponponcat-customize/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

ponponcat\_customize
====================

[](#ponponcat_customize)

このパッケージは、WordPressのテーマカスタマイザーの項目を追加する、ライブラリです。

このパッケージは、ponponcat向けに制作されたものですが、ponponcat以外のテーマでも使用可能です。

Composerでのインストールについて
--------------------

[](#composerでのインストールについて)

次のコマンドを実行する事で、インストール可能です。

```
composer require ponponumi/ponponcat_customize
```

読み込み方法について
----------

[](#読み込み方法について)

functions.phpに、次のように入力してください。(autoload.phpへのパスは、必要に応じて修正してください)

```
require_once __DIR__ . "/vendor/autoload.php";

use Ponponumi\PonponcatCustomize\CustomizeOptionAdd;
```

追加方法について
--------

[](#追加方法について)

次のようにして、項目を追加できます。

```
require_once __DIR__ . "/vendor/autoload.php";

use Ponponumi\PonponcatCustomize\CustomizeOptionAdd;

function custom_color_add($wp_custom){
    $custom = new CustomizeOptionAdd($wp_custom);

    // カラーのパネルを追加
    $custom->panelSet("test_theme_color", [
        'title' => 'test_theme カラー設定',
        'priority' => 151,
    ]);

    // メインカラーのセクションを追加
    // この場合、test_theme_colorというパネルと連携されます。
    $custom->sectionSet("test_theme_color_main", [
        'title' => 'メインカラー設定',
    ]);

    // テーマカラーのセッティングを追加
    // この場合、test_theme_colorというパネルと、test_theme_color_mainというセクションと連携されます。
    $custom->settingSet("test_theme_color_main_themecolor", [
        'label' => 'テーマカラーの設定',
        'type' => 'color'
    ], [
        'default' => '#68c2fe',
        'transport' => 'refresh',
    ]);

    // テキストカラーのセクションを追加
    // この場合、test_theme_colorというパネルと連携されます。
    $custom->sectionSet("test_theme_color_text", [
        'title' => 'テキストカラー設定',
    ]);

    // 本文のカラーのセッティングを追加
    // この場合、test_theme_colorというパネルと、test_theme_color_textというセクションと連携されます。
    $custom->settingSet("test_theme_color_text_body", [
        'label' => '本文のカラーの設定',
        'type' => 'color'
    ], [
        'default' => '#444444',
        'transport' => 'refresh',
    ]);

    // 見出しテキストのカラーのセッティングを追加
    // この場合、test_theme_colorというパネルと、test_theme_color_textというセクションと連携されます。
    $custom->settingSet("test_theme_color_text_hedding", [
        'label' => '見出しテキストのカラーの設定',
        'type' => 'color'
    ], [
        'default' => '#222222',
        'transport' => 'refresh',
    ]);
}
add_action('customize_register', 'custom_color_add');
```

シンプル用のクラスについて
-------------

[](#シンプル用のクラスについて)

上記のコードと、全く同じ動きを、次のコードで実現できます。

```
require_once __DIR__ . "/vendor/autoload.php";

use Ponponumi\PonponcatCustomize\CustomizeOptionAddSimple;

function custom_color_add($wp_custom){
    $custom = new CustomizeOptionAddSimple($wp_custom);

    // この場合、テーマ名を「test_theme」に変更します。
    // このコードを記述しない場合、テーマ名は「ponponcat」になります。
    $custom->themeNameChange("test_theme");

    // カラーのパネルを追加
    // パネル名は「${themeName}_${panelName}」となります。
    // この場合は「test_theme_color」になります。
    $custom->panelSet("color", [
        'title' => 'test_theme カラー設定',
        'priority' => 151,
    ]);

    // メインカラーのセクションを追加
    // この場合、test_theme_colorというパネルと連携されます。
    // セクション名は「${themeName}_${panelName}_${sectionName}」となります。
    // この場合は「test_theme_color_main」になります。
    $custom->sectionSet("main", [
        'title' => 'メインカラー設定',
    ]);

    // テーマカラーのセッティングを追加
    // この場合、test_theme_colorというパネルと、test_theme_color_mainというセクションと連携されます。
    // 設定名は「${themeName}_${panelName}_${sectionName}_${setting}」となります。
    // この場合は「test_theme_color_main_themecolor」になります。
    $custom->settingSet("themecolor", [
        'label' => 'テーマカラーの設定',
        'type' => 'color'
    ], [
        'default' => '#68c2fe',
        'transport' => 'refresh',
    ]);

    // テキストカラーのセクションを追加
    // この場合、test_theme_colorというパネルと連携されます。
    // セクション名は「${themeName}_${panelName}_${sectionName}」となります。
    // この場合は「test_theme_color_text」になります。
    $custom->sectionSet("text", [
        'title' => 'テキストカラー設定',
    ]);

    // 本文のカラーのセッティングを追加
    // この場合、test_theme_colorというパネルと、test_theme_color_textというセクションと連携されます。
    // 設定名は「${themeName}_${panelName}_${sectionName}_${setting}」となります。
    // この場合は「test_theme_color_text_body」になります。
    $custom->settingSet("body", [
        'label' => '本文のカラーの設定',
        'type' => 'color'
    ], [
        'default' => '#444444',
        'transport' => 'refresh',
    ]);

    // 見出しテキストのカラーのセッティングを追加
    // この場合、test_theme_colorというパネルと、test_theme_color_textというセクションと連携されます。
    // 設定名は「${themeName}_${panelName}_${sectionName}_${setting}」となります。
    // この場合は「test_theme_color_text_hedding」になります。
    $custom->settingSet("hedding", [
        'label' => '見出しテキストのカラーの設定',
        'type' => 'color'
    ], [
        'default' => '#222222',
        'transport' => 'refresh',
    ]);
}
add_action('customize_register', 'custom_color_add');
```

CustomizeOptionAddSimpleクラス実行後の設定名の取得について
-----------------------------------------

[](#customizeoptionaddsimpleクラス実行後の設定名の取得について)

次のコードで、簡単に取得できます。

```
require_once __DIR__ . "/vendor/autoload.php";

use Ponponumi\PonponcatCustomize\CustomizeSimpleNameGetStatic;

$bodyTextColor = CustomizeSimpleNameGetStatic::get("test_theme","color","text","body");
var_dump($bodyTextColor);   // string(26) "test_theme_color_text_body"
```

CustomizeOptionAddクラス、CustomizeOptionAddSimpleクラスの実行の注意点
--------------------------------------------------------

[](#customizeoptionaddクラスcustomizeoptionaddsimpleクラスの実行の注意点)

必ず、次の順で実行してください。

1. themeNameChangeメソッドを実行(CustomizeOptionAddSimpleクラスのみ)
2. panelSetメソッドを実行
3. sectionSetメソッドを実行
4. settingSetメソッドを実行

- 上記の順で実行しないと、エラーが起こります。
- セッティングを追加後、同じセクションに再度セッティングを追加したい場合、そのままsettingSetメソッドを実行してください。
- セッティングを追加後、同じパネルに再度セクションを追加したい場合、そのままsectionSetメソッドを実行してください。
- セッティングを追加後、パネルにを追加したい場合、そのままpanelSetメソッドを実行してください。

ライセンスについて
---------

[](#ライセンスについて)

このパッケージは、GPL 2.0 (GNU GENERAL PUBLIC LICENSE 2.0)として作成されています。

このパッケージを使い、商用利用、再配布、改変は可能ですが、ソースコードを非公開のまま配布したり、互換性のないライセンス(MITなど)を適用させたりすることはできません。

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance40

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 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

2

Last Release

507d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/33330e24ced26a4d62456dc643833f584a458b10734b7988189558e6156a3668?d=identicon)[ponponumi](/maintainers/ponponumi)

---

Top Contributors

[![ponponumi](https://avatars.githubusercontent.com/u/123799676?v=4)](https://github.com/ponponumi "ponponumi (108 commits)")

### Embed Badge

![Health badge](/badges/ponponumi-ponponcat-customize/health.svg)

```
[![Health](https://phpackages.com/badges/ponponumi-ponponcat-customize/health.svg)](https://phpackages.com/packages/ponponumi-ponponcat-customize)
```

PHPackages © 2026

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