Support » Plugin: Jetpack by » Using Photon in plugins

Viewing 1 replies (of 1 total)
  • Plugin Contributor designsimply



    Thanks for asking about this! If the Photon module is not active, the user has made a choice to not activate it and plugins should respect that choice.

    First, to determine if Jetpack is installed and can generate photon URLs, use the function you’ve already posted in your original question:

    function_exists( ‘jetpack_photon_url' )

    Then, to determine if Photon is an active Jetpack module, use this:

    class_exists( 'Jetpack' ) && method_exists( 'Jetpack', 'get_active_modules' ) && in_array( 'photon', Jetpack::get_active_modules() )

    I have also updated the Photon support page with this info:

    Aside: I paraphrased this from a conversation I had with the Jetpack developers. So, props
    mdawaffe, viper007bond, and tmoorewp. 🙂

Viewing 1 replies (of 1 total)
  • The topic ‘Using Photon in plugins’ is closed to new replies.