All Topics
Issues with acp/filtering/dropdown_args hook
Hello Support
Today we upgraded the plugin from an older version to 6.4+ which means that the dropdowns is now populated through AJAX.
Unfortunately we are no longer able to modify the dropdowns anymore with the dropdown_args hook.
We follow the procedure as outlined here: https://github.com/codepress/admin-columns-hooks/blob/master/acp-filtering-dropdown_args.php
Here is our code that is no longer working:
function acp_custom_7it_dato_sortering( $args, AC\Column $column ) {
if ( $column instanceof AC\Column\Meta && 'dato_for_levering' === $column->get_meta_key() ) {
$new = $args['options'];
uksort($new,function($a,$b){
$au = strtotime(str_replace("/","-",$a));
$bu = strtotime(str_replace("/","-",$b));
return $bu <=> $au;
});
$args['options'] = $new;
unset($args['order']);
}
$args['limit'] = 1000;
return $args;
}
add_filter( 'acp/filtering/dropdown_args', 'acp_custom_7it_dato_sortering', 10, 2 );
We are only receiving 500-ish results with AJAX, even with the
$args['limit'] = 1000;
This implies that the hook is not working at all. Are there new hooks implemented for the new AJAX methods?
Best regards,
Patrick @ 7it ApS
You must be logged in to reply to this topic.