-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSupWPPlugin.php
More file actions
57 lines (47 loc) · 1.48 KB
/
SupWPPlugin.php
File metadata and controls
57 lines (47 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/*
Plugin Name: SupWPPlugin
Plugin URI:
Description: Mon premier plugin WordPress
Author: Valentin Gratz
Version: 0.0.1
Author URI: http://www.valentin-gratz.xyz
*/
function displayEnabled(){
echo "<script> alert('Mon plugin est active !') </script>";
}
// crochet qui va executer generateCSS
function generateCSS(){
wp_register_style('monCSSBootstrap', plugins_url('SupWPPlugin/assets/bootstrap.css'));
}
add_action( 'admin_head', 'generateCSS' );
function displayAdminMenu(){
wp_enqueue_style('monCSSBootstrap');
echo "<h1>SupWPPlugin</h1><br>
<h2>Accueil</h2>
<p>Tu es sur la page de mon extension.</p>
<br>
<h3>A quoi sert le plugin ? </h3>
<p>Pour le moment à rien, c'est juste le premier plugin que je développe en formation.</p>
<br><br>
<h3>Informations de maintenance</h3>
<br>
<p>Plugin Name: SupWPPlugin<br>
Plugin URI:<br>
Description: Mon premier plugin WordPress<br>
Author: Valentin Gratz<br>
Version: 0.0.1<br>
Author URI: http://www.valentin-gratz.xyz
<br><br>
Compatible : version 5.6</p>";
}
function createMenu(){
add_menu_page("SupWPPlugin",
"MonPlugin",
"manage_options",
"monPlugin",
"displayAdminMenu",
"",
1);
}
add_action('admin_menu', "createMenu"); //mettre en dehors de la function