|
@@ 51-56 (lines=6) @@
|
| 48 |
|
if ( 'term' === $object_type ) { |
| 49 |
|
$object = get_term( intval( $id ) ); |
| 50 |
|
|
| 51 |
|
if ( is_wp_error( $object ) && $object->get_error_code() === 'invalid_taxonomy' ) { |
| 52 |
|
// Fetch raw term. |
| 53 |
|
$columns = implode( ', ', array_unique( array_merge( Defaults::$default_term_checksum_columns, array( 'term_group' ) ) ) ); |
| 54 |
|
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared |
| 55 |
|
$object = $wpdb->get_row( $wpdb->prepare( "SELECT $columns FROM $wpdb->terms WHERE term_id = %d", $id ) ); |
| 56 |
|
} |
| 57 |
|
} |
| 58 |
|
|
| 59 |
|
if ( 'term_taxonomy' === $object_type ) { |
|
@@ 59-63 (lines=5) @@
|
| 56 |
|
} |
| 57 |
|
} |
| 58 |
|
|
| 59 |
|
if ( 'term_taxonomy' === $object_type ) { |
| 60 |
|
$columns = implode( ', ', array_unique( array_merge( Defaults::$default_term_taxonomy_checksum_columns, array( 'description' ) ) ) ); |
| 61 |
|
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared |
| 62 |
|
$object = $wpdb->get_row( $wpdb->prepare( "SELECT $columns FROM $wpdb->term_taxonomy WHERE term_taxonomy_id = %d", $id ) ); |
| 63 |
|
} |
| 64 |
|
|
| 65 |
|
return $object ? $object : false; |
| 66 |
|
} |