We're Moving to a New Support Platform – Starting June 1st!

We’re excited to let you know that starting June 1st, we’ll be transitioning to a new support system that will be available directly on our product websites – Amelia, wpDataTables, and Report Builder. In fact, the new support platform is already live for Amelia and wpDataTables, and we encourage you to reach out to us there.

You'll always be able to reach us through a widget in the bottom right corner of each website, where you can ask questions, report issues, or simply get assistance.

While we still do not offer live support, a new advanced, AI-powered assistant, trained on our documentation, use cases, and real conversations with our team, is there to help with basic to intermediate questions in no time.

We're doing our best to make this transition smooth and hassle-free. After June 1st, this current support website will redirect you to the new "Contact Us" pages on our product sites.

Thanks for your continued support and trust – we’re excited to bring you an even better support experience!

Okay
  Public Ticket #867917
Fatal error: Call to a member function setFilterType() on a non-object in
Closed

Comments

  •  1
    Sam started the conversation

    Hi there,

    I'm trying to use the wpdatatables_filter_mysql_query filter with this simple piece of code:

    function show_praktisch_team ($query, $table_id) {
     $teamcodesl = getteamcode();
     $query = "SELECT * FROM wp_wpdatatable_2 WHERE wdt_ID = '1'";
     echo $query;
     return $query;
    }
    add_filter('wpdatatables_filter_mysql_query', 'show_praktisch_team',1,2);

    When executing this code, the next error appears:

    Fatal error: Call to a member function setFilterType() on a non-object in /home/ascnieuwland.nl/public_html/wp.ascnieuwland.nl/wp-content/plugins/wpdatatables/source/class.wpdatatable.php on line 1725

    I guess I'm using the wrong syntax for the SQL query, but I can not find any documentation on the correct syntax. Could you please help?

    Thanks in advance!

    Cheers,

    Sam

  • [deleted] replied

    Hi Sam,
    Thank you for your purchase.

    Please send me temporary login credentials of your website so I can take a look. You can write them here just mark replay as private so nobody can see it. 

  •  1
    Sam replied

    Hi Milos,

    Thanks for the quick response. Just half an hour ago I managed to solve the problem. Re-creating the table and using a proper syntax for the SQL query did the tric. Apologies for opening this ticket, it can be closed!

    However, I have another issue when using 2 tables on 1 page, it looks like the wpDataTables filter applies to both of them. Should I open a separate ticket for that?

    Cheers,

    Sam

  • [deleted] replied

    Hi Sam,

    No need for opening new ticket. Great that you have resolved issue.

    You can add condition because you have $table_id as a parameter to apply function just for that table. e.g.

    if ( $table_id == 2 ) {
        $query = "SELECT * FROM wp_wpdatatable_2 WHERE wdt_ID = 1";
        return $query;
    }
  •  1
    Sam replied

    Hi Milos,

    Thanks a lot; life can be so simple :-). Should have thought of that solution myself. Everything is clear for now, thanks again for your help!

    Cheers,

    Sam

  • [deleted] replied

    Hi Sam,

    You are welcome. If you are satisfied with our plugin and support please rate our plugin on CodeCanyon on this link. It means a lot to us. Thanks.