- 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細)
「関数リファレンス/shortcode exists」の版間の差分
提供: WordPress Codex 日本語版
< 関数リファレンス
(英語版をコピペ。) |
(和訳完了。) |
||
1行目: | 1行目: | ||
− | = | + | <div id="Description"> |
− | + | == 説明 == | |
+ | </div> | ||
+ | 特定のショートコード有無をチェックする関数です。 | ||
− | = | + | <div id="Parameters"> |
− | {{Parameter|$tag|string| | + | == パラメーター == |
+ | </div> | ||
+ | {{Parameter|$tag|string|チェックされるショートコード}} | ||
− | = | + | <div id="Return"> |
− | {{Return||bool| | + | == 戻り値 == |
+ | </div> | ||
+ | {{Return||bool|ショートコードが登録されていれば <tt>true</tt>。さもなくば <tt>false</tt>}} | ||
− | = | + | <div id="Usage"> |
− | + | == 使用法 == | |
+ | </div> | ||
+ | <?php if ( shortcode_exists( 'gallery' ) ) { } ?> | ||
− | = | + | <div id="Example"> |
+ | == 使用例 == | ||
+ | </div> | ||
<pre> | <pre> | ||
<?php | <?php | ||
if ( shortcode_exists( 'gallery' ) ) { | if ( shortcode_exists( 'gallery' ) ) { | ||
− | // | + | // [gallery] のショートコードが存在する |
} | } | ||
22行目: | 32行目: | ||
</pre> | </pre> | ||
− | = | + | <div id="Change Log"> |
− | * | + | == 改訂履歴 == |
+ | </div> | ||
+ | * [[Version 3.6|3.6.0]] にて導入されました。 | ||
− | = | + | <div id="Source File"> |
+ | == ソースファイル == | ||
+ | </div> | ||
<!-- Need links to current source code files --> | <!-- Need links to current source code files --> | ||
− | <tt>shortcode_exists()</tt> | + | <tt>shortcode_exists()</tt> は {{Trac|wp-includes/shortcodes.php}} にあります。 |
− | + | ||
− | + | ||
+ | <div id="Related"> | ||
+ | == 関連項目 == | ||
+ | </div> | ||
{{Shortcode Tags}} | {{Shortcode Tags}} | ||
{{Tag Footer}} | {{Tag Footer}} | ||
+ | |||
+ | {{原文|Function Reference/shortcode exists copy|134472}}<!-- 12:58, 14 August 2013 Djkaz 版 --> | ||
[[Category:Functions]] | [[Category:Functions]] | ||
[[Category:New_page_created]] | [[Category:New_page_created]] |
2013年8月14日 (水) 22:06時点における版
特定のショートコード有無をチェックする関数です。
パラメーター
- $tag
- (string) (必須) チェックされるショートコード
- 初期値: なし
戻り値
- (bool)
- ショートコードが登録されていれば true。さもなくば false
使用法
<?php if ( shortcode_exists( 'gallery' ) ) { } ?>
使用例
<?php if ( shortcode_exists( 'gallery' ) ) { // [gallery] のショートコードが存在する } ?>
改訂履歴
- 3.6.0 にて導入されました。
ソースファイル
shortcode_exists() は wp-includes/shortcodes.php
にあります。
関連項目
ショートコード: do_shortcode(), add_shortcode(), remove_shortcode(), remove_all_shortcodes(), shortcode_atts(), strip_shortcodes(), shortcode_exists(), has_shortcode(), get_shortcode_regex(), wp_audio_shortcode(), wp_video_shortcode(), フィルター no_texturize_shortcodes /en
関数リファレンス、テンプレートタグ目次もご覧ください。
最新英語版: WordPress Codex » Function Reference/shortcode exists copy (最新版との差分)