Yoast\WP\SEO\Repositories
Indexable_Cleanup_Repository::count_indexables_for_object_type_and_source_table()
Counts indexables for given source table + source identifier + object type.
Метод класса: Indexable_Cleanup_Repository{}
Хуков нет.
Возвращает
Разное
.
Использование
$Indexable_Cleanup_Repository = new Indexable_Cleanup_Repository(); $Indexable_Cleanup_Repository->count_indexables_for_object_type_and_source_table( $source_table, $source_identifier, $object_type );
- $source_table(строка) (обязательный)
- The source table.
- $source_identifier(строка) (обязательный)
- The source identifier.
- $object_type(строка) (обязательный)
- The object type.
Код Indexable_Cleanup_Repository::count_indexables_for_object_type_and_source_table() Indexable Cleanup Repository::count indexables for object type and source table Yoast 23.5
public function count_indexables_for_object_type_and_source_table( string $source_table, string $source_identifier, string $object_type ) { global $wpdb; $indexable_table = Model::get_table_name( 'Indexable' ); $source_table = $wpdb->prefix . $source_table; // phpcs:disable WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching -- Reason: Already prepared. return $wpdb->get_col( " SELECT count(*) FROM {$indexable_table} indexable_table LEFT JOIN {$source_table} AS source_table ON indexable_table.object_id = source_table.{$source_identifier} WHERE source_table.{$source_identifier} IS NULL AND indexable_table.object_id IS NOT NULL AND indexable_table.object_type = '{$object_type}'" )[0]; // phpcs:enable }