Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Create abstract admin classes

Aperta
#158 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
php
Ambito
backend

Direzione di ricerca

Inizia esaminando le implementazioni amministrative dedicate esistenti in Memberships e CSV Import/Export, quindi confrontale con WC_Settings_Page. Definisci l’astrazione condivisa per le pagine di menu, le schede, le sezioni, la gestione delle pagine delle impostazioni e l’esposizione di current_tab e current_section a JavaScript. Il lavoro sarà considerato completato quando il design sarà concordato e il framework supporterà questi requisiti senza boilerplate specifico del plugin.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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)
Lingua principale
PHP
Stelle
146
Fork
43
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di godaddy-wordpress/wc-plugin-framework

Tutte le issue di godaddy-wordpress/wc-plugin-framework

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.