<?php
/**
* Plugin Name: Wonder Fan
* Plugin URI: http://blog.csdn.net/wonderfan
* Description: This plugin is created by WF
* Version: 1.0.0
* Author: 276659702@qq.com
*/
if(!class_exists('WP_WF')){
class WP_WF {
public function __construct() {
}
}
}
//usage : [sc firstname="good" lastname="china"]
function my_shortcode($attr){
$attr = shortcode_atts(array('firstname'=>'','lastname'=>''), $attr);
return 'this is my shortcode and the name is '.$attr['firstname'];
}
add_shortcode('sc', 'my_shortcode');
[PHP] create plugin and short code in WordPress
最新推荐文章于 2021-03-28 05:52:47 发布