wip first shortcode
This commit is contained in:
21
plugins/fipf_wp_plugin/fipf_wp_hooks.php
Normal file
21
plugins/fipf_wp_plugin/fipf_wp_hooks.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/*
|
||||
Plugin Name: fipf_wp_plugin
|
||||
Plugin URI:
|
||||
Description:
|
||||
Author: hugogogo
|
||||
Version: 1.1.0
|
||||
Author URI:
|
||||
*/
|
||||
|
||||
include_once(dirname(__FILE__) . '/utils/consolelog.php');
|
||||
|
||||
|
||||
function main_shortcode() {
|
||||
|
||||
consolelog("hello from php");
|
||||
|
||||
}
|
||||
add_shortcode('fipf_wp_plugin', 'main_shortcode');
|
||||
|
||||
?>
|
||||
11
plugins/fipf_wp_plugin/utils/consolelog.php
Normal file
11
plugins/fipf_wp_plugin/utils/consolelog.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
// https://stackify.com/how-to-log-to-console-in-php/
|
||||
|
||||
function consolelog($output) {
|
||||
$js_code = 'console.log(' . json_encode($output, JSON_HEX_TAG) . ');';
|
||||
$js_code = '<script>' . $js_code . '</script>';
|
||||
echo $js_code;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user