Title: Code Snippets CPT
Author: Justin Sternberg
Published: <strong>2014年12月20日</strong>
Last modified: 2017年4月5日

---

プラグインを検索

![](https://s.w.org/plugins/geopattern-icon/code-snippets-cpt_385b5a.svg)

# code-snippets-cpt

 作者: [Justin Sternberg](https://profiles.wordpress.org/jtsternberg/)

 * [詳細](https://ja.wordpress.org/plugins/code-snippets-cpt/#description)
 * [レビュー](https://ja.wordpress.org/plugins/code-snippets-cpt/#reviews)
 * [開発](https://ja.wordpress.org/plugins/code-snippets-cpt/#developers)

 [サポート](https://wordpress.org/support/plugin/code-snippets-cpt/)

## 説明

このプラグインの公開は2025年3月6日に停止されており、ダウンロードできません。 理由:
セキュリティ上の問題。

## 評価

![](https://secure.gravatar.com/avatar/eb26ebe749779cf4dc946c841d61a0987eaface0a59c43d6bfdf2bf983711a77?
s=60&d=retro&r=g)

### 󠀁[Outstanding – Does What it Says, and Does it Well](https://wordpress.org/support/topic/outstanding-does-what-it-says-and-does-it-well/)󠁿

 [Chad Butler](https://profiles.wordpress.org/cbutlerjr/) 2017年5月4日 1 reply

This is an outstanding plugin. It does exactly what it says and it does it well.
As a developer who runs a few blogs that provide code snippets, I needed a solution
that was beyond just displaying code snippets in my posts (where then the code snippet
was part of the post content). I needed something to keep the actual code snippets
separate from the post content. This plugin does that perfectly. As described, snippets
are saved as CPTs (Custom Post Types) and the code snippet can then be used in a
post as a shortcode. That would have been good enough for me on its own, but Code
Snippets CPT takes it a step farther. Justin allows snippets to be categorized and
tagged, and the editor also displays the necessary shortcode for you. Added bonus:
when writing post content it adds a button to the editor to find snippet shortcodes
to insert. Let me add that as a professional developer who makes their living with
WordPress, I have pretty high standards. I’ve seen and tested a lot of plugins that
should never see the light of day. So when I give a 5 star rating, I mean it. And
I would give this 6 stars if I could.

![](https://secure.gravatar.com/avatar/94550a49b6bcd8cc4d821cb9ac310e39d306e22984c038db0d475ae676614e76?
s=60&d=retro&r=g)

### 󠀁[Very handsome plugin, but no way to execute!](https://wordpress.org/support/topic/very-handsome-plugin-but-no-way-to-execute/)󠁿

 [makdev](https://profiles.wordpress.org/makdev/) 2017年1月29日 1 reply

Great for creating and maintaining what I call a custom CODELIB. But without an 
alternative to choose some of this code to execute on my site this has only exhibition
value… What’s the use of me knowing how to create a custom WP role, for example,
if I cannot utilize it on my site when needed?

![](https://secure.gravatar.com/avatar/a1d21769c6d0ddd960f0b2bacd99e6f2e24a9b623b4c33df1043c404bbc4df7d?
s=60&d=retro&r=g)

### 󠀁[Excellent](https://wordpress.org/support/topic/excellent-3874/)󠁿

 [philippenantes](https://profiles.wordpress.org/philippenantes/) 2016年10月31日
2 replies

Does what is says. Would be great if shortcode could accept en ID as a parameter.
Would be great if description would show the slug of the cpt, which is ‘code-snippets’
Would be great also to have a straight forward example of a query to dispplay all
snippets on a page. For those who would like to see an example, this is what i did
in a template page : // WP_Query arguments $args = array ( ‘post_type’ => ‘code-
snippets’, ‘posts_per_page’ => ‘-1’, ‘order’ => ‘ASC’, ); // The Query $myquery 
= new WP_Query( $args ); while ($myquery->have_posts()) { $myquery->the_post(); ?
> <article id=”page-<?php the_ID(); ?>” class=”page” role=”article”> <header class
=”page-header”> <h1 class=”page-title”><?php the_title(); ?></h1> </header> <?php
echo do_shortcode(‘[snippet slug=’.$post->post_name.’ lang=php]’); ?> </article>
<?php } wp_reset_postdata();

![](https://secure.gravatar.com/avatar/8e4ce80a4094e63e2966ef5eb11982baba5aa128b22c3c88df5a71be71112dec?
s=60&d=retro&r=g)

### 󠀁[The only code snippet plugin you need](https://wordpress.org/support/topic/the-only-code-snippet-plugin-you-need/)󠁿

 [modemlooper](https://profiles.wordpress.org/modemlooper/) 2016年9月3日 1 reply

Works great. As the snippets are CPTs they can be backed up and utilized in different
ways.

![](https://secure.gravatar.com/avatar/cf0b9932064404f4280b9751233adc32ef022eeaed77b475b42908cc4d5a709f?
s=60&d=retro&r=g)

### 󠀁[Excellent](https://wordpress.org/support/topic/excellent-3188/)󠁿

 [thorirv](https://profiles.wordpress.org/thorirv/) 2016年9月3日 1 reply

Simple, effective and not least, looks damn nice!

 [ 8件のレビューをすべて表示 ](https://wordpress.org/support/plugin/code-snippets-cpt/reviews/)

## 貢献者と開発者

Code Snippets CPT はオープンソースソフトウェアです。以下の人々がこのプラグインに
貢献しています。

貢献者

 *   [ Justin Sternberg ](https://profiles.wordpress.org/jtsternberg/)

[“Code Snippets CPT” をあなたの言語に翻訳しましょう。](https://translate.wordpress.org/projects/wp-plugins/code-snippets-cpt)

### 開発に興味がありますか ?

[コードを閲覧](https://plugins.trac.wordpress.org/browser/code-snippets-cpt/)する
か、[SVN リポジトリ](https://plugins.svn.wordpress.org/code-snippets-cpt/)をチェック
するか、[開発ログ](https://plugins.trac.wordpress.org/log/code-snippets-cpt/)を 
[RSS](https://plugins.trac.wordpress.org/log/code-snippets-cpt/?limit=100&mode=stop_on_copy&format=rss)
で購読してみてください。

## メタ

 *  バージョン **2.1.0**
 *  最終更新日 **9年前**
 *  有効インストール数 **該当なし**
 *  言語
 * [English (US)](https://wordpress.org/plugins/code-snippets-cpt/)
 *  [詳細を表示](https://ja.wordpress.org/plugins/code-snippets-cpt/advanced/)