| @@ -226,18 +226,18 @@ | ||
| 226 | 226 | $users = array( $wpdb->prefix . 'users', $wpdb->prefix . 'usermeta' ); |
| 227 | 227 | $terms = array( $wpdb->prefix . 'terms', $wpdb->prefix . 'termmeta' ); |
| 228 | 228 | $comments = array( $wpdb->prefix . 'comments', $wpdb->prefix . 'commentmeta' ); |
| 229 | 229 | |
| 230 | - if ( in_array( $table1, $posts ) && in_array( $table2, $posts ) ) { | |
| 230 | + if ( in_array( $table1, $posts, true ) && in_array( $table2, $posts, true ) ) { | |
| 231 | 231 | return $wpdb->prefix . 'posts.ID = ' . $wpdb->prefix . 'postmeta.post_id'; |
| 232 | 232 | } |
| 233 | - if ( in_array( $table1, $users ) && in_array( $table2, $users ) ) { | |
| 233 | + if ( in_array( $table1, $users, true ) && in_array( $table2, $users, true ) ) { | |
| 234 | 234 | return $wpdb->prefix . 'users.ID = ' . $wpdb->prefix . 'usermeta.user_id'; |
| 235 | 235 | } |
| 236 | - if ( in_array( $table1, $terms ) && in_array( $table2, $terms ) ) { | |
| 236 | + if ( in_array( $table1, $terms, true ) && in_array( $table2, $terms, true ) ) { | |
| 237 | 237 | return $wpdb->prefix . 'terms.term_id = ' . $wpdb->prefix . 'termmeta.term_id'; |
| 238 | 238 | } |
| 239 | - if ( in_array( $table1, $comments ) && in_array( $table2, $comments ) ) { | |
| 239 | + if ( in_array( $table1, $comments, true ) && in_array( $table2, $comments, true ) ) { | |
| 240 | 240 | return $wpdb->prefix . 'comments.comment_id = ' . $wpdb->prefix . 'commentmeta.comment_id'; |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | return apply_filters( 'visualizer_db_fk_constraint', '', $table1, $table2 ); |
| @@ -336,9 +336,9 @@ | ||
| 336 | 336 | * |
| 337 | 337 | * @access public |
| 338 | 338 | * @return array |
| 339 | 339 | */ |
| 340 | - public static function get_all_db_tables_column_mapping() { | |
| 340 | + public static function get_all_db_tables_column_mapping( $chart_id, $use_filter = true ) { | |
| 341 | 341 | $mapping = array(); |
| 342 | 342 | $tables = self::get_db_tables(); |
| 343 | 343 | foreach ( $tables as $table ) { |
| 344 | 344 | $cols = self::get_db_table_columns( $table, true ); |
| @@ -343,8 +343,11 @@ | ||
| 343 | 343 | foreach ( $tables as $table ) { |
| 344 | 344 | $cols = self::get_db_table_columns( $table, true ); |
| 345 | 345 | $names = wp_list_pluck( $cols, 'name' ); |
| 346 | 346 | $mapping[ $table ] = $names; |
| 347 | + } | |
| 348 | + if ( $use_filter ) { | |
| 349 | + return apply_filters( 'visualizer_db_tables_column_mapping', $mapping, $chart_id ); | |
| 347 | 350 | } |
| 348 | 351 | return $mapping; |
| 349 | 352 | } |
| 350 | 353 | |