first commit

This commit is contained in:
2023-09-12 21:41:04 +02:00
commit 3361a7f053
13284 changed files with 2116755 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
<?php
/**
* Class WPML_Media_Attachments_Query
*/
class WPML_Media_Attachments_Query implements IWPML_Action {
public function add_hooks() {
add_action( 'pre_get_posts', array( $this, 'adjust_attachment_query' ), 10 );
}
/**
* Set `suppress_filters` to false if attachment is displayed.
*
* @param WP_Query $query
*
* @return WP_Query
*/
public function adjust_attachment_query( $query ) {
if ( isset( $query->query['post_type'] ) && 'attachment' === $query->query['post_type'] ) {
$query->set( 'suppress_filters', false );
}
return $query;
}
}