- 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細)
「関数リファレンス/register nav menus」の版間の差分
提供: WordPress Codex 日本語版
< 関数リファレンス
細 (テンプレートタグガイド・カテゴリ挿入、リンク調整等/翻訳者募集中) |
細 (見出し訳) |
||
2行目: | 2行目: | ||
{{テンプレートタグガイド|PHP}} | {{テンプレートタグガイド|PHP}} | ||
− | == | + | == 説明 == |
Registers ''multiple'' [[Navigation Menus|custom navigation menus]] in the new custom menu editor of WordPress 3.0. This allows for creation of custom menus in the dashboard for use in your theme. | Registers ''multiple'' [[Navigation Menus|custom navigation menus]] in the new custom menu editor of WordPress 3.0. This allows for creation of custom menus in the dashboard for use in your theme. | ||
See [[関数リファレンス/register_nav_menu|register_nav_menu()]] for creating a single menu, and [[Navigation_Menus|Navigation Menus]] for adding theme support. | See [[関数リファレンス/register_nav_menu|register_nav_menu()]] for creating a single menu, and [[Navigation_Menus|Navigation Menus]] for adding theme support. | ||
− | == | + | == 使い方 == |
<?php register_nav_menus( $locations ); ?> | <?php register_nav_menus( $locations ); ?> | ||
− | == | + | == パラメータ == |
{{Parameter|$locations|array|An associated array of menu location slugs and descriptions.}} | {{Parameter|$locations|array|An associated array of menu location slugs and descriptions.}} | ||
− | == | + | == 戻り値 == |
− | + | なし | |
− | == | + | == 用例 == |
<pre> | <pre> | ||
32行目: | 32行目: | ||
</pre> | </pre> | ||
− | == | + | == 注 == |
* This function automatically registers custom menu support for the theme therefore you do '''not''' need to call <code>add_theme_support( 'menus' );</code> | * This function automatically registers custom menu support for the theme therefore you do '''not''' need to call <code>add_theme_support( 'menus' );</code> | ||
43行目: | 43行目: | ||
* Use [[関数リファレンス/wp_nav_menu|wp_nav_menu()]] to display your custom menu. | * Use [[関数リファレンス/wp_nav_menu|wp_nav_menu()]] to display your custom menu. | ||
− | == | + | == 更新履歴 == |
− | * | + | * 導入: [[Version 3.0|3.0.0]] |
− | == | + | == ソースファイル == |
− | * <tt>register_nav_menus()</tt> | + | * <tt>register_nav_menus()</tt> は {{Trac|wp-includes/nav-menu.php}}にあります。 |
− | == | + | == 関連 == |
* [[Theme Review#Functionality|Theme Review - Guidelines]] | * [[Theme Review#Functionality|Theme Review - Guidelines]] |
2015年5月16日 (土) 20:45時点における版
このページ「関数リファレンス/register nav menus」は未翻訳です。和訳や日本語情報を加筆してくださる協力者を求めています。
タグ一覧: テンプレートタグ | インクルードタグ | 条件分岐タグ | その他の関数 | Code Reference
使い方: テンプレートタグ入門 | パラメータの渡し方 | 初心者の方へ | その他のテーマ関連資料
説明
Registers multiple custom navigation menus in the new custom menu editor of WordPress 3.0. This allows for creation of custom menus in the dashboard for use in your theme.
See register_nav_menu() for creating a single menu, and Navigation Menus for adding theme support.
使い方
<?php register_nav_menus( $locations ); ?>
パラメータ
- $locations
- (array) (必須) An associated array of menu location slugs and descriptions.
- 初期値: なし
戻り値
なし
用例
if ( function_exists( 'register_nav_menus' ) ) { register_nav_menus( array( 'pluginbuddy_mobile' => 'PluginBuddy Mobile Navigation Menu', 'foot_menu' => 'My Custom Footer Menu' ) ); }
注
- This function automatically registers custom menu support for the theme therefore you do not need to call
add_theme_support( 'menus' );
- Verify the function exists prior to usage to provide backwards compatibility before WordPress 3.0.0:
if ( function_exists( 'register_nav_menus' ) ) { ... }
- Use wp_nav_menu() to display your custom menu.
更新履歴
- 導入: 3.0.0
ソースファイル
- register_nav_menus() は
wp-includes/nav-menu.php
にあります。
関連
ナビゲーションメニュー: register_nav_menus(), register_nav_menu(), unregister_nav_menu() /en , has_nav_menu(), wp_nav_menu(), wp_get_nav_menu_items()
関数リファレンス、テンプレートタグ目次もご覧ください。
最新英語版: WordPress Codex » Function Reference/register_nav_menus (最新版との差分)