get_attachment_template

Sponsored Link

現在または親テンプレートに添付ファイルのテンプレートの取得パスを指定します。

添付ファイルのパスを最初にチェックしている場合、MIMEタイプの最初の部分に存在しています。セカンドチェックは、mimeタイプの第2部分です。最後のチェックはアンダースコアで区切られた両方のタイプです。
どちらも’attachment.php’ファイルを発見している場合は、チェックして返します。

‘text / plain’をMIMEタイプのいくつかの例は、’text.php’、’plain.php’、最後に’text_plain.php’です。

Sponsored Link

Retrieve path of attachment template in current or parent template.

The attachment path first checks if the first part of the mime type exists. The second check is for the second part of the mime type. The last check is for both types separated by an underscore. If neither are found then the file ‘attachment.php’ is checked and returned.

Some examples for the ‘text/plain’ mime type are ‘text.php’, ‘plain.php’, and finally ‘text_plain.php’.

get_attachment_templateのファンクションタグ使用方法

<?php get_attachment_template() ?>

get_attachment_templateのパラメーター

None.

戻り値

(string)

現在あるいは親テンプレートの添付テンプレートのパスを返します。

Returns path of attachment template in current or parent template.

注釈

  • Uses: get_query_template()
  • Uses global: (object) $posts a property of the WP_Query object.

変更ログ

Since: 2.0.0

ソースファイル

get_attachment_template()内のwp-includes/theme.phpに位置しています。

get_attachment_template() is located in wp-includes/theme.php.

Sponsored Link