Skip to content

Commit

Permalink
Prevent any dates or locations being leaked out by tagline while site…
Browse files Browse the repository at this point in the history
… is on Coming Soon mode (#946)
  • Loading branch information
timiwahalahti authored Sep 8, 2023
1 parent 3c74962 commit dd69c56
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public function __construct() {
add_action( 'admin_notices', array( $this, 'block_new_post_admin_notice' ) );
add_filter( 'get_post_metadata', array( $this, 'jetpack_dont_email_post_to_subs' ), 10, 4 );
add_filter( 'publicize_should_publicize_published_post', array( $this, 'jetpack_prevent_publicize' ) );
add_filter( 'document_title_parts', array( $this, 'force_empty_tagline' ) );

add_image_size( 'wccsp_image_medium_rectangle', 500, 300 );
}
Expand Down Expand Up @@ -540,4 +541,21 @@ public function jetpack_prevent_publicize( $should_publicize ) {
return $should_publicize;
}

/**
* Prevent any dates or locations being leaked out by tagline while site is on Coming Soon mode.
*
* @param array $parts The document title parts.
*
* @return array The document title parts.
*/
public function force_empty_tagline( $parts ) {
$settings = $GLOBALS['WCCSP_Settings']->get_settings();

if ( 'on' === $settings['enabled'] ) {
$parts['tagline'] = '';
}

return $parts;
}

} // end WordCamp_Coming_Soon_Page.

0 comments on commit dd69c56

Please sign in to comment.