この条件タグは、ユーザーがモバイルデバイスを使用して訪問しているかをチェックします。これはboolean関数で、TRUEまたはFALSEのいずれかを返します。
リファレンス
get_the_terms
記事に所属しているタクソノミーのタームを取得します。
get_taxonomies
登録されているタクソノミーオブジェクトのリストを取得します。
get_tags
post_tagタクソノミーに各タームにおけるオブジェクトの配列を返します。
taxonomy_exists
この条件タグは、それへ引数としてタクソノミー名を渡すことでタクソノミー名が存在している場合にチェックします。これはboolean関数がタクソノミー名が存在する場合にチェックするために、グローバル$wp_taxonomies変数を使用して、タクソノミー名が存在する場合はTRUEあるいはタクソノミ名が存在しない場合はFALSEのいづれかを返すことを意味しています。
This Conditional Tag checks if the taxonomy name exists by passing a taxonomy name as an argument to it. This is a boolean function uses a global $wp_taxonomies variable for checking if taxonomy name existence, meaning it returns either TRUE if the taxonomy name exist or FALSE if it doesn’t exist.
taxonomy_existsのファンクションタグ使用方法
<?php taxonomy_exists($taxonomy); ?>
taxonomy_existsのパラメーター
$taxonomy
(string) (required)タクソノミーの名前
デフォルト:なし
(string) (required) The name of the taxonomy
Default: None
戻り値
(boolean)
成功した場合にtrue、失敗した場合にはfalseを返します。
(boolean)
True on success, false on failure.
例
$taxonomy_exist = taxonomy_exists('category'); //trueを返します。 $taxonomy_exist = taxonomy_exists('post_tag'); //trueを返します。 $taxonomy_exist = taxonomy_exists('link_category'); //trueを返します。 $taxonomy_exist = taxonomy_exists('my_taxonomy'); //グローバル$wp_taxonomies['my_taxonomy']が設定されていない場合、falseを返します。
注意
参照:WordPress_Taxonomy
See Also: WordPress_Taxonomy.
変更ログ
Since: 3.0
ソースファイル
taxonomy_exists()は、wp-includes/taxonomy.php内に位置しています。
taxonomy_exists() is located in wp-includes/taxonomy.php.
関連ファンクションタグ
post_type_exists()
Conditional Tags: comments_open(), is_404(), is_admin(), is_admin_bar_showing(), is_archive(), is_attachment(), is_author(), is_category(), is_comments_popup(), is_date(), is_day(), is_feed(), is_front_page(), is_home(), is_local_attachment(), is_multi_author, is_month(), is_new_day(), is_page(), is_page_template(), is_paged(), is_plugin_active(), is_plugin_active_for_network(), is_plugin_inactive(), is_plugin_page(), is_post_type_archive(), is_preview(), is_search(), is_single(), is_singular(), is_sticky(), is_tag(), is_tax(), is_taxonomy_hierarchical(), is_time(), is_trackback(), is_year(), in_category(), in_the_loop(), is_active_sidebar(), is_active_widget(), is_blog_installed(), is_rtl(), is_dynamic_sidebar(), is_user_logged_in(), has_excerpt(), has_post_thumbnail(), has_tag(), pings_open(), email exists(), post_type_exists(), taxonomy_exists(), term_exists(), username exists(), wp_attachment_is_image(), wp_script_is()
term_exists
取得したタームが存在するかどうかを確認し、タームIDを返します。タームが存在しない場合は、タームオブジェクトあるいは0(false)を返します。
get_terms
タクソノミーのタームやタクソノミーのリストを取得します。
load_plugin_textdomain
プラグインの翻訳された文字列を読み込みます。
get_term
タームIDによってデータベースから全てのタームデータを取得します。名前、スラッグ、IDでタームデータを取得するには、代わりにget_term_by() を使用してください。
get_query_template
拡張子を使用せずにファイルのパスを取得します。
ファイルの拡張子を含まないファイルのパスを直接取得するために使用します。locate_template()の使用でファイルが存在する場合、親テンプレートのチェックもします。他のget_*_template()関数の使用することなくより汎用的なファイルの場所が可能となります。
パスを取得するためにinclude()あるいはrequire()を使用することができます。