-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Meta Box Custom Table - Hook for replace List_Table #1593
Comments
Thanks for your feedback. Do you mean replacing the instance of the list table class with your own? Or ability to change the class name? I'd love to hear more details on this. And what exactly do you need with that? Can't the current class satisfy the needs? |
Oh excuse me for the late answer! I really appreciate your interest! I would like to replace the class instance with mine. This is possible in the core through the hook apply_filters( 'wp_list_table_class_name', string $class_name, array $args ) But using custom templates instead of the classic post type this hook obviously doesn’t work anymore. Your table has no problem on simple CRUD, but working on complex architectures or with a lot of logic becomes a little limiting and with a result "dirty" approach to customize it using hooks |
Currently, the code to create an instance of list table class is this: $this->list_table = new ListTable( [
'model' => $this->model,
] ); I'm going to change it to: $args = [
'model' => $this->model,
];
$list_table = new ListTable( $args );
$this->list_table = apply_filters( 'mbct_list_table_object', $list_table, $args ); So this adds a filter to the object of the list table class (not the class name as in your code). This way, you can modify the object (create your own class, instantiate it and then pass to the filter). Does that help you? |
Thank you!!! This is great news! |
Can you send me your email so I can send you the beta version? |
Sure. Check your mail, I send a message. Thank you!! |
Hi, is there a hook to handle row actions? It is available for bulk actions, but for row actions there is nothing in the documentations. |
Using the extension MB Custom table is currently not possible to replace the table List_Table. It would therefore be useful to have a hook to replace it with a custom.
The text was updated successfully, but these errors were encountered: