Open Muffinman opened 1 year ago
I've been looking into this again, and I think it would allow developers much more flexibility if one or both of the following could be added:
Model::get_fitlering_data()
to allow options to be updated by developersclass FormattedRelation extends ACP\Filtering\Model\Meta {
public function get_filtering_data() {
$values = $this->get_meta_values();
$options = [];
foreach ( $values as $value ) {
$options[ $value ] = $this->column->get_formatted_value( $value );
}
// Allow options data to be changed with filter
$options = apply_filters( 'acp/filtering/filtering_options', $options, $this->column );
return [
'empty_option' => true,
'options' => $options,
];
}
}
assets/filtering/table.js
to send through active filtering params to acp_update_filtering_cache
.
Hi,
We have a client requirement where one dropdown needs to filter the items available in the second. They also need the options very specifically sorting based on an order they enter themselves in the admin. These fields are all ACF fields.
e.g. Selecting an option in
Competition
here will need to filter the options available inSection
Looking at the filters available for ACP, this almost seems like it's possible with
acp/filtering/dropdown_args
.However the first thing that happens on page load is that an ajax request to
acp_update_filtering_cache
which overwrites the custom data and ordering we just applied.Is there some way of doing what we need, without resorting to developing custom Dropdown field types?