![eycatch](https://whatswp.t-haku.com/wp-content/uploads/admin-dashboard-widget-1.png)
ダッシュボード
ウィジェットへ追加
![ボー](https://whatswp.t-haku.com/wp-content/themes/whatswp/balloon/b-board.png)
ダッシュボードのウィジェットはどうやって追加するのですにゃ?
![ワープ](https://whatswp.t-haku.com/wp-content/themes/whatswp/balloon/b-wp.png)
テーマのfunctions.phpかプラグインにwp_dashboard_setupアクション・フックでwp_add_dashboard_widget ()すれば追加できるにゃ。
![](https://whatswp.t-haku.com/wp-content/uploads/admin-dashboard-widget.png)
ダッシュボードにウィジェット追加
add_action('wp_dashboard_setup', 'my_dashboard_setup');
function my_dashboard_setup() {
wp_add_dashboard_widget('my-dashboard-widget', 'リンク集', 'my_dashboard_widget');
}
function my_dashboard_widget() {
echo "<h2>Myリンク集</h2>";
echo "<ul>";
echo '<li><a href="https://github.com/WordPress/WordPress/" target="_blank">GitHub</a>';
echo '<li><a href="https://wpdocs.osdn.jp/WordPress_%E3%83%AA%E3%83%B3%E3%82%AF%E9%9B%86" target="_blank">WordPress リンク集</a>';
echo "</ul>";
}
![メリー](https://whatswp.t-haku.com/wp-content/themes/whatswp/balloon/b-mary.png)
くわしくは以下を参照するでありますにゃ。
関連ファイル
![メリー](https://whatswp.t-haku.com/wp-content/themes/whatswp/balloon/b-mary.png)
関連するPHPファイルは以下でありますにゃ。