- 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細)
「関数リファレンス/has post format」の版間の差分
(英語版をコピペ) |
(和訳完了。) |
||
1行目: | 1行目: | ||
− | = | + | <div id="Description"> |
− | + | == 説明 == | |
+ | </div> | ||
+ | 投稿に特定の[[Post Formats|投稿フォーマット]]がアサインされている (<tt>true</tt>) か否 (<tt>false</tt>) かを、 boolean で返す関数です。これは通常、 [[The Loop|The Loop()]] の中で呼び出されますが、投稿 ID があればどこででも用いることが出来ます。 | ||
− | = | + | <div id="Usage"> |
+ | == 使用法 == | ||
+ | </div> | ||
+ | <?php $format = has_post_format($format,$post_id); ?> | ||
− | + | <div id="Parameters"> | |
+ | == パラメーター == | ||
+ | </div> | ||
+ | {{Parameter|$format|string|array|投稿フォーマット名またはそれの配列|必須|none}} | ||
+ | {{Parameter|$post_id|integer|投稿の ID|オプション|現状のループ投稿}} | ||
− | == | + | <div id="Change Log"> |
− | + | == 改訂履歴 == | |
− | + | </div> | |
+ | [[Version 3.1]] にて導入されました。 | ||
− | = | + | <div id="Source File"> |
− | + | == ソースファイル == | |
− | + | </div> | |
− | + | <tt>has_post_format()</tt> は {{Trac|wp-includes/post-formats.php}} にあります。 | |
− | == | + | |
− | + | ||
− | <tt>has_post_format()</tt> | + | |
{{原文| Function Reference/has post format |140889}}<!-- 06:02, January 31, 2014 Djkaz 版 --> | {{原文| Function Reference/has post format |140889}}<!-- 06:02, January 31, 2014 Djkaz 版 --> |
2014年2月2日 (日) 14:16時点における版
投稿に特定の投稿フォーマットがアサインされている (true) か否 (false) かを、 boolean で返す関数です。これは通常、 The Loop() の中で呼び出されますが、投稿 ID があればどこででも用いることが出来ます。
使用法
<?php $format = has_post_format($format,$post_id); ?>
パラメーター
- $format
- (string|array) (必須) 投稿フォーマット名またはそれの配列
- 初期値: none
- $post_id
- (integer) (オプション) 投稿の ID
- 初期値: 現状のループ投稿
改訂履歴
Version 3.1 にて導入されました。
ソースファイル
has_post_format() は wp-includes/post-formats.php
にあります。
最新英語版: WordPress Codex » Function Reference/has post format (最新版との差分)
投稿フォーマット: set_post_format(), get_post_format(), has_post_format(), the_post_format_audio() /en, get_the_post_format_media() /en, get_content_audio() /en, the_post_format_chat() /en, get_the_post_format_chat() /en, get_content_chat() /en, add_chat_detection_format() /en, the_post_format_gallery() /en, get_content_galleries() /en, get_post_gallery_images(), the_post_format_image() /en, get_the_post_format_image() /en, get_content_images() /en, the_post_format_quote() /en, get_the_post_format_quote() /en, get_content_quote() /en, the_post_format_url() /en, get_the_post_format_url() /en, get_content_url() /en, the_post_format_video() /en, get_content_video() /en, the_remaining_content() /en, get_the_remaining_content() /en, get_post_format_meta() /en, post_format_content_class() /en, get_post_format_content_class() /en, post_formats_compat() /en