Skip to content

Instantly share code, notes, and snippets.

@inc2734
Last active February 15, 2017 06:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inc2734/158b59217bee19a2db9b1ba3692a8a6d to your computer and use it in GitHub Desktop.
Save inc2734/158b59217bee19a2db9b1ba3692a8a6d to your computer and use it in GitHub Desktop.
ぺちぱな用サンプルプラグイン
<?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