wip first shortcode
This commit is contained in:
35
Makefile
Normal file
35
Makefile
Normal file
@@ -0,0 +1,35 @@
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
|
||||
# . name = value \ . += append to a variable #
|
||||
# VARIABLES . value . != set result of command #
|
||||
# . name is case sensitive . ?= set if not already set #
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
|
||||
|
||||
WP_DOCKER_D = ./wordpress_docker
|
||||
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
|
||||
# . target: prerequisites . $@ : target #
|
||||
# RULES . recipe . $< : 1st prerequisite #
|
||||
# . recipe . $^ : all prerequisites #
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
|
||||
|
||||
|
||||
all:
|
||||
$(MAKE) $@ -C $(WP_DOCKER_D)
|
||||
|
||||
fclean:
|
||||
$(MAKE) $@ -C $(WP_DOCKER_D)
|
||||
|
||||
re:
|
||||
$(MAKE) $@ -C $(WP_DOCKER_D)
|
||||
|
||||
erase:
|
||||
$(MAKE) $@ -C $(WP_DOCKER_D)
|
||||
|
||||
new:
|
||||
$(MAKE) $@ -C $(WP_DOCKER_D)
|
||||
|
||||
|
||||
.PHONY : all fclean re erase new
|
||||
|
||||
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