Create abstract admin classes
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
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
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&¤t_sectionavailable in JS (similar topagenow)
- 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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di godaddy-wordpress/wc-plugin-framework
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
godaddy-wordpress/wc-plugin-framework#806 · 2 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 52/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
Google Pay Missing Environment VariableForse già presa Una pull request collegata a questa issue è aperta o già unita. ApertaGoogle Pay JavaScript
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
-
i18n Needs Reporter Feedabck
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
godaddy-wordpress/wc-plugin-framework#536 · 1 commento ·
Tutte le issue di godaddy-wordpress/wc-plugin-framework
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
codeigniter4/CodeIgniter4#10616 ·
I maintainer di solito rispondono entro 1 giorno
-
bug code quality
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
SemanticMediaWiki/SemanticMediaWiki#7149 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
FriendsOfFlarum/upload#527 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
google/site-kit-wp#13825 ·
I maintainer di solito rispondono entro 3 giorni