wip handle puting files and var on front
This commit is contained in:
@@ -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');
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user