Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/wp-includes/taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -4066,8 +4066,13 @@
// Get the object and term IDs and stick them in a lookup table.
$tax_obj = get_taxonomy( $taxonomy );
$object_types = esc_sql( $tax_obj->object_type );
$results = $wpdb->get_results( "SELECT object_id, term_taxonomy_id FROM $wpdb->term_relationships INNER JOIN $wpdb->posts ON object_id = ID WHERE term_taxonomy_id IN (" . implode( ',', array_keys( $term_ids ) ) . ") AND post_type IN ('" . implode( "', '", $object_types ) . "') AND post_status = 'publish'" );

$results = $wpdb->get_results(
$wpdb->prepare(
"SELECT object_id, term_taxonomy_id FROM $wpdb->term_relationships INNER JOIN $wpdb->posts ON object_id = ID WHERE term_taxonomy_id IN (" . implode( ',', array_fill( 0, count( $term_ids ), '%d' ) ) . ") AND post_type IN (" . implode( ',', array_fill( 0, count( $object_types ), '%s' ) ) . ") AND post_status = 'publish'",

Check failure on line 4071 in src/wp-includes/taxonomy.php

View workflow job for this annotation

GitHub Actions / Coding standards / PHP checks

String ") AND post_type IN (" does not require double quotes; use single quotes instead

Check failure on line 4071 in src/wp-includes/taxonomy.php

View workflow job for this annotation

GitHub Actions / Coding standards / PHP checks

String ") AND post_type IN (" does not require double quotes; use single quotes instead
array_merge( array_keys( $term_ids ), $object_types )
)
);

Check failure on line 4075 in src/wp-includes/taxonomy.php

View workflow job for this annotation

GitHub Actions / Coding standards / PHP checks

Whitespace found at end of line

Check failure on line 4075 in src/wp-includes/taxonomy.php

View workflow job for this annotation

GitHub Actions / Coding standards / PHP checks

Whitespace found at end of line
foreach ( $results as $row ) {
$id = $term_ids[ $row->term_taxonomy_id ];

Expand Down
Loading