File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " idearia/wordpress-settings-api-class" ,
3
3
"description" : " WordPress settings API Abstraction Class" ,
4
- "keywords" : [" wp" ," wordpress" , " settings-api" ],
4
+ "keywords" : [" wp" , " wordpress" , " settings-api" ],
5
5
"type" : " library" ,
6
6
"license" : " GPL-3.0-or-later" ,
7
7
"homepage" : " https://github.com/Idearia/wordpress-settings-api-class" ,
Original file line number Diff line number Diff line change 3
3
4
4
namespace Idearia ;
5
5
6
- defined ( 'ABSPATH ' ) || exit;
7
-
8
6
/**
9
7
* Crea una pagina generica di menu in WordPress e mostrala come
10
8
* voce di menu a se stante oppure come sottovoce di un menu
@@ -79,6 +77,12 @@ abstract class MenuPage
79
77
* Registra gli hooks
80
78
*/
81
79
public function __construct () {
80
+ if ( ! $ this ->label ) {
81
+ throw new \Exception ( 'Label non definita! ' );
82
+ }
83
+ if ( ! $ this ->slug ) {
84
+ throw new \Exception ( 'Slug non definita! ' );
85
+ }
82
86
add_action ( 'admin_menu ' , array ( $ this , 'admin_menu ' ), $ this ->filterPriority );
83
87
}
84
88
@@ -107,9 +111,8 @@ public function admin_menu() {
107
111
}
108
112
109
113
/**
110
- * Funzione usata per renderizzare l'HTML
114
+ * Funzione usata per renderizzare l'HTML; deve fare
115
+ * echo di qualcosa.
111
116
*/
112
- public function view () {
113
- return 'Hello world! ' ;
114
- }
117
+ abstract public function view ();
115
118
}
You can’t perform that action at this time.
0 commit comments