Linux 软件免费装
Banner图

PFT – Widget Spacing Control

开发者 piftoworks
更新时间 2026年6月9日 17:22
PHP版本: 7.4 及以上
WordPress版本: 7.0
版权: GPLv2 or later
版权网址: 版权信息

标签

widget sidebar responsive margin spacing

下载

1.2.2 1.2.3

详情介绍:

PFT – Widget Spacing Control adds margin-top / margin-bottom inputs (desktop and mobile, separately) to every widget's settings form. Negative values are supported, so you can both expand and tighten the space between widgets without adding empty spacer widgets. Features How priority is guaranteed To make sure your margin settings always win over theme and other plugin CSS:
  1. A triple-ID selector (#id#id#id) raises specificity to 0-3-0-0, beating typical theme selectors.
  2. !important is added on every declaration as a second line of defense.
  3. Styles are output via wp_footer at priority 9999, so they load after all other styles.
Media queries are used to switch between desktop and mobile values cleanly (inline styles are intentionally avoided because inline !important would override @media rules). Responsive breakpoints

安装:

  1. Upload the widget-spacing-control folder to /wp-content/plugins/, or install via the Plugins screen in WordPress.
  2. Activate the plugin through the Plugins screen.
  3. Go to Appearance → Widgets. Each widget now has a "余白設定 (Spacing)" section at the bottom of its form.
  4. Enter values (positive or negative integers) for PC and/or mobile, then save the widget.

升级注意事项:

1.2.3 Internationalization: widget form labels are now translatable. UI displayed in user's WordPress locale when translations are available. 1.2.2 Internal refactor to align with WordPress.org plugin standards (CSS is now enqueued via wp_add_inline_style(), and a consistent pftwsc_ function prefix is used). No behavior changes; recommended update. 1.2.1 Bug fix: mobile margin values are now applied correctly. Previously, PC values were leaking onto mobile due to inline-style specificity overriding the media query. Recommended update. 1.2.0 Security and standards: output escaping and license headers added. No behavior changes.

常见问题:

Does it work with block-based widgets / Full Site Editing?

It targets the classic widget system that uses in_widget_form and dynamic_sidebar_params. Block widgets in FSE themes are not the target use case.

Will it conflict with my theme's CSS?

No. The plugin uses inline styles, a high-specificity selector, and late-loaded <style> output, so it overrides theme CSS in all common cases.

Does it store any personal data?

No. The plugin only saves margin values (integers) in the widget instance options. No personal data is collected or transmitted.

Where are the settings saved?

Inside each widget's instance settings (under WordPress's standard widget_* options), with keys wsc_mt_pc, wsc_mt_sp, wsc_mb_pc, wsc_mb_sp.

更新日志:

1.2.3 1.2.2 1.2.1 1.2.0 1.1.0 1.0.0