Skip to content
This repository was archived by the owner on Jan 26, 2021. It is now read-only.

REST API opt in queries

David Arenas edited this page Jan 21, 2019 · 11 revisions

Frontity WP plugin adds the next queries to the REST API:

Html Purifier

  • htmlPurifier=true

    Activates the Html Purifier. Not implemented yet.

  • purgeHtmlPurifierCache=true

    Purges the internal cache of the Html Purifier. Not implemented yet.

  • disableHtmlPurifierCache=true

    Disables the internal cache of the Html Purifier. Not implemented yet.

  • htmlPurifierAllowedAttributes=tag:attr1,tag:attr2...

    Doesn't remove those attributes from the content html. Use first the tag followed by a colon and the atribute: tag:attribute. For example, div:data-title or iframe:frameborder. Not implemented yet.

  • htmlPurifierAllowedEmptyTags=tag1,tag2...

    Doesn't remove those tags from the content html if they come empty. Not implemented yet.

Content Media

  • contentMedia=true

    • Extracts ids from the content images and add data-attachment-id.

    • Adds a content_media array with those ids.

    • Adds a new endpoint to /wp/v2/media in _links to retrieve all those images when using _embed=true.

      Not implemented yet.

  • dataAttachmentIdSources=true

    Adds data-attachment-id-source attributes to the html. Not implemented yet.

  • disableContentMediaWpQuery=true

    Disables the last resort when looking for image ids, which is using a WP Query. Not implemented yet.

  • purgeContentMediaTransients=true

    Purges the WP transients created each time a WP Query is made to look for an image id. Not implemented yet.

  • disableContentMediaTransients=true

    Disables the use of WP transients each time a WP Query is made to look for an image id. Not implemented yet.

Filter Fields

  • fields=field1,field2...

    If present, the API only includes those fields in the response. Similar to the field fields of the WP.com REST API or the plugin REST API – Filter Fields. Not implemented yet.

  • excludeFields=field1,field2...

    If present, the API excludes those fields from the response. Not implemented yet.

Text (or decoded) fields

  • titleText=true

    Includes a title.text field which is both decoded and doesn't have html tags. Not implemented yet.

  • excerptText=true

    Includes a excerpt.text field which is both decoded and doesn't have html tags. Not implemented yet.

Latest

  • latest=true
    • Adds a latest array, similar to other taxonomies.

    • Adds a new endpoint to /wp/v2/latest in _links to retrieve that taxonomy when using _embed=true.

      Not implemented yet.

Forbidden Media (error 403)

  • fixForbiddenMedia=true If present, the plugin detach those media images requested that belong to unpublished posts, in order to avoid a rest_forbidden error.