Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Compatibility with Media Library Folders Pro plugin

$
0
0

Replies: 0

Hi, one our customers uses our plugin, Media Library Folders Pro with Polylang and there is an issue that when both plugins are activated, no images are display in the media popup when creating/editing posts. For some reason, this issue does not show up when editing a page.

Our plugin modifies the query-attachments query by using both the posts_where and posts_join filter hooks to show images for a particular folder in the media library.

After making a small modification to Polylang filters.php file, it seems to work. In the posts_where function I changed

return $this->model->is_translated_post_type( $post->post_type ) && ! empty( $this->curlang ) ? $sql . $this->model->post->where_clause( $this->curlang ) : $sql;
to

$retval = $this->model->is_translated_post_type( $post->post_type ) && ! empty( $this->curlang ) ? $sql . $this->model->post->where_clause( $this->curlang ) : $sql;
error_log($retval);
return $retval;

Calling error_log() makes the images appear. But I don’t know if this causes any issue for Polylang or if there is a better way to fix this.


Viewing all articles
Browse latest Browse all 59525

Trending Articles