Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Create abstract admin classes

オープン
#158 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
php
領域
backend

調査の方向性

まず Memberships と CSV Import/Export にある既存の専用管理画面実装を確認し、その後 WC_Settings_Page と比較します。メニューページ、タブ、セクション、設定ページの連携、および current_tab と current_section を JavaScript に公開するための共通抽象化を定義します。設計について合意が得られ、フレームワークがプラグイン固有のボイラープレートなしでこれらの要件をサポートできれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Feature

A lot of our plugins are using dedicated admin pages outside of WC Settings area. Some plugins simply have a dedicated settings page while others have more complex admin areas with settings, list tables, etc (Memberships, CSV Import/Export). To create those admin areas, a lot of boilerplate code is needed, and each plugin implements things a bit different. This makes it harder to maintain.

We should look into creating some sort of abstraction that would allow plugins to easily register dedicated admin areas/pages/settings, with support for tabs & sections out-of-the-box. This could reduce boilerplate code and provide a more consistent experience & architecture in plugins.

For settings pages, we could probably subclass WC_Settings_Page and make it more generic, to support adding settings pages to other plugin admin areas, rather than to WC Settings.

I would imagine some kind of abstract admin class that would already have all the plumbing required for adding the menu/submenu pages, tabs and sections. The subclass would then simply need to provide a list of tabs & sections and callbacks for rendering those.

Perhaps something like

Admin_Area extends SV_WC_Admin_Area {

  public __construct() {

    $this->tabs = array(
        'tab_1' => array(
            'label' => __( 'Tab 1' ),
            'sections' => array(
                'section_1' => __( 'Section 1' ),
                'section_2' => __( 'Section 2' ),
            ),
        ),
        'tab_2' => __( 'Tab 2' ),
    );

  }


  public function render_tab_1( $current_section ) {
    // .. render the tab...
  }

}

In summary, some of the features that would be nice:

  • a common structure for adding dedicated admin areas/pages
  • built-in support for tabs and sections
  • built-in support for the plumbing required for settings pages
  • making current_tab && current_section available in JS (similar to pagenow)
主要言語
PHP
スター
146
フォーク
43
PR マージ指標
30日以内にマージされた PR はありません

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

godaddy-wordpress/wc-plugin-framework のほかの issue

godaddy-wordpress/wc-plugin-framework の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。