Can you help us understand the scenario better? Where will the dynamic value come from?
Thread Starter
ilakya
(@ilakya)
I want to use wordpress function get_current_user_id() call like
select * from tablename where userid = get_current_user_id() as the requirement is to show chart for particular user id.
If calling get_current_user_id() is not possible, is there any other way to pass user ID of currently logged in user to the query?
You can use the below snippet in the latest version of the plugin:
add_filter( 'visualizer_db_query', function( $query, $chart_id ) {
$query = str_replace( "LIMIT 1000", " WHERE " . userid = get_current_user_id() . " LIMIT 1000", $query );
return $query;
}, 10, 2 );
We haven’t heard from you in sometime so marking this as Resolved. If you continue to face an issue, please create a new ticket. We’d be happy to help.