篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php facetwp ACF Multi Dates Field picker相关的知识,希望对你有一定的参考价值。
<?php
/** index ACF Multi Dates Field picker addon fields which are saved as an array **/
add_filter( 'facetwp_index_row', function( $params, $class ) {
if ( 'MY_FACET' == $params['facet_name'] ) { // change MY_FACET to name of your facet
$values = maybe_unserialize( $params['facet_value'] );
if ( is_array( $values ) && ! empty( $values ) ) {
foreach ( $values as $value ) {
$new_params = $params;
$new_params['facet_value'] = $value;
$new_params['facet_display_value'] = $value;
$class->insert( $new_params ); // insert new value to the database
}
return false; // don't index original
}
}
return $params;
}, 10, 2 );
以上是关于php facetwp ACF Multi Dates Field picker的主要内容,如果未能解决你的问题,请参考以下文章