diff --git a/plugins/fipf_wp_plugin/fipf_wp_hooks.php b/plugins/fipf_wp_plugin/fipf_wp_hooks.php index f30f040..bc2c154 100644 --- a/plugins/fipf_wp_plugin/fipf_wp_hooks.php +++ b/plugins/fipf_wp_plugin/fipf_wp_hooks.php @@ -15,6 +15,7 @@ Author URI: include_once(dirname(__FILE__) . '/utils/console_log.php'); include_once(dirname(__FILE__) . '/utils/add_to_front.php'); +include_once(dirname(__FILE__) . '/utils/create_html.php'); @@ -31,12 +32,13 @@ function main_shortcode() { )); # send scripts files by name, without extension .js - add_script_to_front( array( + add_scripts_to_front( array( "myscript", "myscript2", "myscript3", )); + $myvar_1 = "I am one"; $myvar_2 = "I am two"; # maybe a future version of php will allow to @@ -44,18 +46,32 @@ function main_shortcode() { # https://wiki.php.net/rfc/nameof # but for now i have to declare both the variable and its name # (more : https://stackoverflow.com/q/255312/9497573) -# add_var_to_front( array( -# "myvar_1" => $myvar_1, -# "myvar_2" => $myvar_2, -# )); add_var_to_front( array( - $myvar_1, - $myvar_2, + "myvar_1" => $myvar_1, + "myvar_2" => $myvar_2, )); + return create_html( array( + "index.html", + "index2.html", + )); } add_shortcode('fipf_wp_plugin', 'main_shortcode'); -?> +/* * * * * * * * * * * * * * * * * * * * * * * * + * menu plugin + */ +function plugin_menu() { + add_menu_page( + 'FIPF wp plugin', // webpage title + 'FIPF', // menu title + 'manage_options', // capability + 'fipf-wp-plugin', // menu_slug + 'fipf_wp_plugin_content' // callback function to display page content + ); +} +add_action('admin_menu', 'plugin_menu'); + +?> diff --git a/plugins/fipf_wp_plugin/html/index.html b/plugins/fipf_wp_plugin/html/index.html new file mode 100644 index 0000000..c01a927 --- /dev/null +++ b/plugins/fipf_wp_plugin/html/index.html @@ -0,0 +1,6 @@ +
i am a new p
+ diff --git a/plugins/fipf_wp_plugin/html/index2.html b/plugins/fipf_wp_plugin/html/index2.html new file mode 100644 index 0000000..f916190 --- /dev/null +++ b/plugins/fipf_wp_plugin/html/index2.html @@ -0,0 +1 @@ +aaaaaand this is the end
diff --git a/plugins/fipf_wp_plugin/html/templates/presentation.html b/plugins/fipf_wp_plugin/html/templates/presentation.html new file mode 100644 index 0000000..a38485d --- /dev/null +++ b/plugins/fipf_wp_plugin/html/templates/presentation.html @@ -0,0 +1 @@ +hello
diff --git a/plugins/fipf_wp_plugin/utils/add_to_front.php b/plugins/fipf_wp_plugin/utils/add_to_front.php index 303d6fe..58dbe25 100644 --- a/plugins/fipf_wp_plugin/utils/add_to_front.php +++ b/plugins/fipf_wp_plugin/utils/add_to_front.php @@ -2,54 +2,39 @@ function add_css_to_front($style_files_arr) { //wp_enqueue_style(