$DinamicValue gets the value from $_GET[‘course_id’]; By using an alert, I can see that the $DinamicValue gets always the proper value.
$DinamicValue is setted before calling the filter.
I am still using this filter, but it does not work…
add_filter( ‘visualizer_db_query’, function( $query, $chart_id ) {
$query = str_replace( "LIMIT 1000", "WHERE project_solution_state_date_2.project_id = " . $DinamicValue . " LIMIT 1000", $query );
return $query;
}, 10, 2 );
I am trying to test it with a hardcoded value (9999), but it still does not recognize it.
add_filter( ‘visualizer_db_query’, function( $query, $chart_id ) {
$query = str_replace( "LIMIT 1000", "WHERE project_solution_state_date_2.project_id = 9999 LIMIT 1000", $query );
return $query;
}, 10, 2 );
Shouldnt there be a comma in the second string LIMIT 1000″? Like this:
`add_filter( ‘visualizer_db_query’, function( $query, $chart_id ) {
$query = str_replace( “LIMIT 1000”, “WHERE project_solution_state_date_2.project_id = 9999″ ,”LIMIT 1000”, $query );
return $query;
}, 10, 2 );`
Looking forward to your answer