added switch on off for server console log
This commit is contained in:
89
plugins/wp_model_plugin/plugin_hooks.php
Normal file
89
plugins/wp_model_plugin/plugin_hooks.php
Normal file
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
/*
|
||||
Plugin Name: wp_model_plugin
|
||||
Plugin URI:
|
||||
Description:
|
||||
Author: hugogogo
|
||||
Version: 1.1.0
|
||||
Author URI:
|
||||
*/
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* globale variable to desable server side
|
||||
* console_log all at once
|
||||
*/
|
||||
|
||||
$CONSOLE_OFF = true;
|
||||
$CONSOLE_OFF = false;
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* inclusions
|
||||
*/
|
||||
|
||||
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');
|
||||
|
||||
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* plugin shortcode
|
||||
*/
|
||||
|
||||
function main_shortcode() {
|
||||
|
||||
add_files_to_front( array(
|
||||
"mystyle.css",
|
||||
"myscript.js",
|
||||
"myscript2.js",
|
||||
"myscript3.js",
|
||||
));
|
||||
|
||||
$myvar_1 = "I am one";
|
||||
$myvar_2 = "I am two";
|
||||
# compact creates an array containing the variables and their value
|
||||
# as key => value
|
||||
# from an array of variables names as strings
|
||||
add_var_to_front( compact(
|
||||
"myvar_1",
|
||||
"myvar_2",
|
||||
));
|
||||
|
||||
|
||||
$names = ["hugo", "camille"];
|
||||
$ages = ["13", "34", "56"];
|
||||
$html_front = create_html(
|
||||
array(
|
||||
"index.html",
|
||||
"index2.html",
|
||||
),
|
||||
compact(
|
||||
"names",
|
||||
"ages",
|
||||
)
|
||||
);
|
||||
|
||||
return $html_front;
|
||||
}
|
||||
add_shortcode('wp_model_plugin', 'main_shortcode');
|
||||
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* menu plugin
|
||||
*/
|
||||
|
||||
function plugin_menu() {
|
||||
add_menu_page(
|
||||
'wp model plugin', // webpage title
|
||||
'model plugin', // menu title
|
||||
'manage_options', // capability
|
||||
'wp-model-plugin', // menu_slug
|
||||
'wp_model_plugin_content' // callback function to display page content
|
||||
);
|
||||
}
|
||||
add_action('admin_menu', 'plugin_menu');
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user