58 lines
1.0 KiB
PHP
58 lines
1.0 KiB
PHP
<?php
|
|
/*
|
|
Plugin Name: fipf_wp_plugin
|
|
Plugin URI:
|
|
Description:
|
|
Author: hugogogo
|
|
Version: 1.1.0
|
|
Author URI:
|
|
*/
|
|
|
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * *
|
|
* inclusions
|
|
*/
|
|
|
|
include_once(dirname(__FILE__) . '/utils/console_log.php');
|
|
include_once(dirname(__FILE__) . '/utils/add_to_front.php');
|
|
|
|
|
|
|
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * *
|
|
* plugin shortcode
|
|
*/
|
|
|
|
function main_shortcode() {
|
|
|
|
# send styles files by name, without extension .css
|
|
add_css_to_front( array(
|
|
"mystyle",
|
|
));
|
|
|
|
# send scripts files by name, without extension .js
|
|
add_script_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
|
|
# get the name of a variable :
|
|
# 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_shortcode('fipf_wp_plugin', 'main_shortcode');
|
|
|
|
|
|
?>
|
|
|