Making WordPress.org

Changeset 5801


Ignore:
Timestamp:
08/15/2017 05:01:21 PM (7 years ago)
Author:
coreymckrill
Message:

WordCamp Coming Soon: Disable JP OpenGraph when Coming Soon enabled

Prevents Jetpack from adding OpenGraph meta tags to document headers
while the Coming Soon page is enabled on a site. These tags were leaking
content from sites while they were still under construction.

Refs #2934
Props RMarks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-coming-soon-page/classes/wordcamp-coming-soon-page.php

    r5603 r5801  
    1313        add_action( 'wp_head',            array( $this, 'render_dynamic_styles' ) );
    1414        add_filter( 'template_include',   array( $this, 'override_theme_template' ) );
     15        add_action( 'template_redirect',  array( $this, 'disable_jetpacks_open_graph' ) );
    1516
    1617        add_image_size( 'wccsp_image_medium_rectangle', 500, 300 );
     
    103104
    104105        return $template;
     106    }
     107
     108    /**
     109     * Disable Jetpack's Open Graph meta tags when the Coming Soon page is active
     110     */
     111    public function disable_jetpacks_open_graph() {
     112        if ( $this->override_theme_template ) {
     113            add_filter( 'jetpack_enable_open_graph', '__return_false' );
     114        }
    105115    }
    106116
Note: See TracChangeset for help on using the changeset viewer.