php facetwp自定义范围和滑块的自定义起点

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php facetwp自定义范围和滑块的自定义起点相关的知识,希望对你有一定的参考价值。

<?php
/** set a custom range for a slider facet and set
 ** the start and end handles to the min/max of range instead of
 ** the min/max of the indexed data
 **/
add_filter( 'facetwp_render_output', function( $output, $params ) {
	if ( isset( $output['settings']['price'] ) ) {
		$output['settings']['price']['range'] = array(
			'min' => array( 0 ),
			'max' => array( 40000 )
		);
		$output['settings']['price']['start'] =  array( 0, 40000 );
	}
	return $output;
}, 10, 2 );

以上是关于php facetwp自定义范围和滑块的自定义起点的主要内容,如果未能解决你的问题,请参考以下文章