=== Plus Features for Advanced Custom Fields === Contributors: thewpcatalyst Donate link: Tags: acfp, plus, acf, advanced custom fields, dual, range, slider, input, dual range slider Requires at least: 5.0 Tested up to: 6.2 Stable tag: 1.0.0 Requires PHP: 7.0 License: GPLv2 or later License URI: Adds Dual range slider to Advanced Custom Fields(ACF) plugin and supports some shortcodes for Email and URL links, Numbers with separators, and text. == Description == Plus Features for Advanced Custom Fields adds a Dual Range Slider field type to the advanced custom field plugin and some basic shortcodes for basic fields in the current post. The Dual Range Slider field type allows you to choose minimum and maximum values. At the moment, the shortcode works on the current post and allows you to Display: - Email **link** from ACF email field type. - URL **link** from ACF URL field type. - Number with **decimals and thousand separators** from ACF number field type. - Text from text, textarea, and range field types. == Installation == Requires to be installed. 1. Upload `acfp` to the `/wp-content/plugins/` directory 1. Activate the plugin through the 'Plugins' menu in WordPress 1. Go to WordPress Admin -> ACF-> Field group -> Select/edit your preferred field group, on field type go to the **Choice** section and select Dual Range Slider. 1. Define your preferred settings. == Usage == = Code = Get Dual range slider value code: if ( function_exists( 'get_field' ) ) { $min_max_array = get_field( 'dual_range_slider' ); if ( is_array( $min_max_array ) && array_key_exists( 'min', $min_max_array ) && array_key_exists( 'max', $min_max_array ) ) { echo 'Min value is: ' . wp_kses( $min_max_array['min'] , array()) . '
'; echo 'Max value is: ' . wp_kses( $min_max_array['max'] , array()); } } Update Dual range slider PHP code: if(function_exists( 'update_field' ) ){ $value=array( 'min'=>20, 'max'=> 35, ); $is_updated=update_field('dual_range_slider_field_name', $value); var_dump($is_updated); } = Shortcodes Examples = [acfp field="text_field_name" field_type="text"] [acfp field="text_area_field_name" field_type="textarea"] [acfp field="range_field_name" field_type="range" ] [acfp field="number_field_name" field_type="number"] [acfp field="number_field_name" format = "separators_decimals" decimal_separator="," thousands_separator="." decimals="4" field_type="number"] [acfp field="email_field_name" format="link" link_text="my email" field_type="email"] [acfp field="email_field_name" link_text="my email" field_type="email"] [acfp field="url_field_name" format="link" link_text="my link" field_type="url"] [acfp field="url_field_name" link_text="my link" field_type="url"] [acfp field="dual_range_slider_field_name" field_type="acfp_dual_range_slider" format="min"] [acfp field="dual_range_slider_field_name" field_type="acfp_dual_range_slider" format="max"] [acfp field="dual_range_slider_field_name" field_type="acfp_dual_range_slider"] == Frequently Asked Questions == = How can I utilize the values selected in dual range slider on my templates? = You can add custom code in your template files as shown below: if ( function_exists( 'get_field' ) ) { $min_max_array = get_field( 'dual_range_slider' ); if ( is_array( $min_max_array ) && array_key_exists( 'min', $min_max_array ) && array_key_exists( 'max', $min_max_array ) ) { echo 'Min value is: ' . wp_kses( $min_max_array['min'] , array()) . '
'; echo 'Max value is: ' . wp_kses( $min_max_array['max'] , array()); } } = How can I update the dual range slider field using PHP code? = You can update the field using an array with max and min keys as shown below: if(function_exists( 'update_field' ) ){ $value=array( 'min'=>20, 'max'=> 35, ); $is_updated=update_field('dual_range_slider_field_name', $value); var_dump($is_updated); } == Screenshots == 1. Dual Range Slider in Admin dashboard post edit. 2. Dual Range slider field settings. 3. Settings continuation. == Changelog == = 1.0.0 = Beginning of ACF Plus. == Upgrade Notice == = 1.0.0 = Beginning of ACF Plus.