How can I order the store list by date??
-
Hi,
I’ve used this plugin with WPML and I made a mistake when I translate the store data. I started to translate the store data at the end of all the record so the order of id is totally different. Then, I would like to ask you about if there is any way to overwrite the sorting by date??
I’ve tried to use below coding and tried to
$custom_sort[$key] = $row['date'];
but it didn’t work.add_filter( 'wpsl_store_data', 'custom_result_sort' ); function custom_result_sort( $store_meta ) { $custom_sort = array(); foreach ( $store_meta as $key => $row ) { $custom_sort[$key] = $row['store']; } array_multisort( $custom_sort, SORT_ASC, SORT_REGULAR, $store_meta ); return $store_meta; }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How can I order the store list by date??’ is closed to new replies.