• 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.

  • The topic ‘Compatibility with Media Library Folders Pro plugin’ is closed to new replies.