Last active
February 15, 2017 06:23
-
-
Save inc2734/158b59217bee19a2db9b1ba3692a8a6d to your computer and use it in GitHub Desktop.
ぺちぱな用サンプルプラグイン
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Sample Plugin | |
* Plugin URI: PLUGIN SITE HERE | |
* Description: PLUGIN DESCRIPTION HERE | |
* Author: YOUR NAME HERE | |
* Author URI: YOUR SITE HERE | |
* Text Domain: sample-plugin | |
* Domain Path: /languages | |
* Version: 0.1.0 | |
* | |
* @package Sample_Plugin | |
*/ | |
/** | |
* ショートコード API | |
* | |
* https://goo.gl/lFcaof | |
* | |
* ショートコードは [foo] のような形式で、記事中に埋め込んで | |
* 任意の HTML や文字列を表示することができるものです。 | |
* ショートコードは `add_shortcode( 'ショートコード名', '関数' );` で定義できます。 | |
*/ | |
/** | |
* 本文を書き換えることができるフィルターフック the_content にフックし | |
* 記事の最後に文字列を付け加える。 | |
*/ | |
add_shortcode( 'phperna', function( $attributes, $content = '' ) { | |
return 'ぺちぱな'; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment