Skip to content

Updates for supporting WPML #329

@NeilWJames

Description

@NeilWJames

An issue has been raised for using WPML (#324)

There is some complexity to integrating it. I believe that the end goal will be to create a plugin to the Cookbook.

However, there are a couple of places where WP Document Revisions should be updated for coexistence:

  1. To generate the permalink, it uses home_url(). With WPML, depending on the language viewpoint, this can be different. A filter document_home_url can added that will allow this modification to be done.

Whilst home_url() does have a filter, its parameters are string information only. Use would need to be made of globals, etc. Using a specific filter, we know that we are dealing with a document - and specifically which one.

  1. When loading a PDF, Wordpress will attempt to create a thumbnail of page 1 of the document. This is held using the name of the attachment - and thus on use will download the encoded name of the document. Currently when this encoding action is done, an additional post_meta record is created denoting this. When WPML is used, it will copy the attachment record and its image metadata record, but not the but not the additional post_meta record

By updating the image metadata record itself (by adding an item to the array), then the functionality is maintained but the WPML process will also copy across the processed flag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions