balaianu/acf-double-range
最新稳定版本:v2.0.0
Composer 安装命令:
composer require balaianu/acf-double-range
包简介
A professional double (min–max) range slider field type for Advanced Custom Fields.
README 文档
README
The ACF Double Range Field extends Advanced Custom Fields by introducing a modern and flexible min–max slider input type. Designed for precision, clarity, and responsiveness, it integrates seamlessly within both the block editor and the classic WordPress experience.
Overview
This plugin provides a clean and intuitive interface for selecting numeric ranges. It combines two synchronized number inputs with a dual-handle slider, offering developers and content editors a more refined way to define numeric intervals.
Key use cases include pricing filters, score ranges, percentage thresholds, or any configuration that requires both a minimum and maximum value.
Features
- Fully compatible with ACF Free and ACF PRO (6.0+)
- Real-time synchronization between slider and numeric inputs
- Smooth cursor behavior and precision typing
- Configurable limits for
min,max, andstepvalues - Adaptive layout for both block editor and sidebar views
- Lightweight implementation with no external dependencies
- Built on WordPress core’s native jQuery UI Slider
Installation
Using Composer (recommended)
Install the plugin directly from your project’s root directory:
composer require balaianu/acf-double-range
Ensure your environment loads the plugin through the standard WordPress bootstrap or an autoloader.
Manual Installation
-
Clone or download the repository:
git clone https://github.com/balaianu/acf-double-range.git
-
Copy the folder into your
wp-content/plugins/directory. -
Activate ACF Double Range Field from the WordPress admin under Plugins → Installed Plugins.
Usage
Once activated, the new field type will appear in your ACF field type list.
-
In ACF → Field Groups → Add Field
-
Choose Field Type → Double Range
-
Configure the field options:
- Minimum Value: The lower bound of the range.
- Maximum Value: The upper bound of the range.
- Step: The incremental value between range steps.
- Default Values: Optional initial minimum and maximum settings.
The resulting interface presents two numeric inputs alongside a synchronized range slider, enabling direct numeric entry or visual adjustment.
Example
[Min Input] — [Slider Track] — [Max Input]
The component automatically validates all inputs, ensuring values remain within the defined limits. Both values are accessible in your template or logic as an associative array:
$range = get_field('price_range'); $min = $range['min']; $max = $range['max'];
Implementation Notes
- The field is powered by the ACF Field API and integrates with the existing
acf.registerFieldTypeJavaScript interface. - Validation and reactivity are handled in real time using native event listeners.
- CSS is minimal and adaptive, optimized for both editor and sidebar contexts.
- Built entirely using WordPress core assets — no third-party libraries required.
Compatibility
| Environment | Supported |
|---|---|
| ACF Free | ✓ |
| ACF PRO (6.0+) | ✓ |
| Classic Editor | ✓ |
| Block Editor / Gutenberg | ✓ |
| PHP 7.4+ | ✓ |
| WordPress 5.8+ | ✓ |
Versioning
The plugin follows Semantic Versioning principles:
- 2.0.0 — Initial public release (production stable)
- 2.1.x — Minor enhancements and refinements
- 3.0.0 — Future major updates with expanded configuration options
License
This plugin is open-source software licensed under the GPLv2 or later license. You are free to use, modify, and distribute it within the terms of that license.
Contributing
Contributions are welcome. Please submit pull requests or open issues through GitHub. For significant changes, start a discussion before submitting a PR.
Maintained by Andrei Balaianu
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2025-10-27