跳到内容

Widgets in Menu for WordPress

v1.0.0

Saurabh · 2014年10月21日 上架

Allows you to add Widgets in WordPress Navigation Menus

正在使用
7,000+
评分
4.8 / 5
累计下载
11 万
最近更新
2018年6月27日
21 条评价需要 WordPress 3.5+已测试到 4.7.40

贡献者

截图

Add any widget to the 'Widgets in Menu' widget area.
Add any widget to the 'Widgets in Menu' widget area.
Your widgets appear in an new metabox on the Edit Menus screen.
Your widgets appear in an new metabox on the Edit Menus screen.
Add your widget to any menu, just like you add pages or posts.
Add your widget to any menu, just like you add pages or posts.
Your widget starts appearing in the navigation menu.
Your widget starts appearing in the navigation menu.
Add css as per taste to finalise the look.
Add css as per taste to finalise the look.

Allows you to add Widgets in WordPress Navigation Menus via a custom widget area and an extra box in menu edit screen.

Warning

You will need to have some CSS skills for the widgets to display properly in nav menus.

Usage

View the screenshots for usage instructions.

Source code and Contributions

Fork on Github

Contributions are always welcome

Documentation

  • Most documentation is inline.
  • The hooks (actions and filters) are documented in the Other Notes.
  • Some useful stuff is in the FAQ section.

Hooks

Actions

yawp_wim_pre_callback

Fires before a widget’s display callback is called. Similar to ‘dynamic_sidebar’ action.

Parameters

  • $yawp_wim_widget array An associative array of widget arguments.
    1. string $name Name of the widget.
    2. string $id Widget ID.
    3. array|callback $callback When the hook is fired on the front-end, $callback is an array containing the widget object. Fired on the back-end, $callback is ‘wp_widget_control’, see $_callback.
    4. array $params An associative array of multi-widget arguments.
    5. string $classname CSS class applied to the widget container.
    6. string $description The widget description.
    7. array $_callback When the hook is fired on the back-end, $_callback is populated with an array containing the widget object, see $callback.

Filters

yawp_wim_attribute_prefix

Filters the prefix used in class/id attributes in html display.

Parameters

  • $default_prefix string The default prefix: ‘yawp_wim’

yawp_wim_widget_params

Filter the parameters passed to the widget’s display callback. Similar to ‘dynamic_sidebar_params’ filter

Parameters

  • $params array
    1. array $args An array of widget display arguments.
      1. string $name Name of the sidebar the widget is assigned to.
      2. string $id ID of the sidebar the widget is assigned to.
      3. string $description The sidebar description.
      4. string $class CSS class applied to the sidebar container.
      5. string $before_widget HTML markup to prepend to each widget in the sidebar.
      6. string $after_widget HTML markup to append to each widget in the sidebar.
      7. string $before_title HTML markup to prepend to the widget title when displayed.
      8. string $after_title HTML markup to append to the widget title when displayed.
      9. string $widget_id ID of the widget.
      10. string $widget_name Name of the widget. }
    2. array $widget_args An array of multi-widget arguments.
      1. int $number Number increment used for multiples of the same widget.

yawp_wim_no_widgets_message

Filters the html displayed if no widgets are present in the sidebar.

Parameters

  • $no_widgets_output array The default output

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums