Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Add is_transforming_instant_article() conditional #568

Commits on Dec 22, 2016

  1. Add is_instant_article conditional

    Adds a new function in the global namespace to check if the current view
    being processed is for an instant article. Handles both the RSS feed and
    content which is being processed for the Instant_Articles_Publisher
    class. This conditional can be checked in any filters on 'the_content',
    'the_title' or elsewhere that need to treat Instant Articles content
    separately from web content.
    goldenapples committed Dec 22, 2016
    Copy the full SHA
    8e54394 View commit details
    Browse the repository at this point in the history
  2. Set the status on the existing action hooks

    Rather than tracking down every place that might call
    Instant_Articles_Post::to_instant_article and wrapping it call to set
    the is_instant_article conditional, it's much simpler to just hook those
    settings on the existing actions `instant_articles_before_transform_post`
    and `instant_articles_after_transform_post`.
    goldenapples committed Dec 22, 2016
    Copy the full SHA
    f81998e View commit details
    Browse the repository at this point in the history

Commits on Jan 24, 2017

  1. Rename function for clarity

    Rename `is_instant_article` to `is_transforming_instant_article`, to
    better indicate that it will return true when a tranformation is being
    processed.
    goldenapples committed Jan 24, 2017
    Copy the full SHA
    aa33ecf View commit details
    Browse the repository at this point in the history
  2. Don't depend on the before_/after_ hooks

    Since these hooks can be modified in plugins, it's safer to set the
    status of is_transforming_instant_article() directly in the
    `Instant_Articles_Post::to_instant_article` method.
    goldenapples committed Jan 24, 2017
    Copy the full SHA
    ca03891 View commit details
    Browse the repository at this point in the history