Skip to content

Instantly share code, notes, and snippets.

View oberonlai's full-sized avatar

Oberon Lai oberonlai

View GitHub Profile
@oberonlai
oberonlai / block.json
Created April 7, 2022 12:44 — forked from carlodaniele/block.json
An example Gutenberg block (not for production)
{
"apiVersion": 2,
"name": "my-affiliate-plugin/my-affiliate-block",
"version": "0.1.0",
"title": "Affiliate Block",
"category": "design",
"icon": "money",
"keywords": [ "kinsta", "affiliate", "money" ],
"description": "An example block for Kinsta readers",
"supports": {
<?php
// add_action("衣架名","要掛上去的衣服名","這件衣服在這衣架的順位")
add_action("woocommerce_before_checkout_form","add_sale_word",10);
// 建立衣服
function add_sale_word(){
// echo 是 php 輸出的語法,輸出內容為你想要放的折扣訊息
echo "<p style='color: red;'>今天結帳享有 66 折優惠~</p>";