Skip to content

Commit

Permalink
Add file for privacy related functions
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonMayerhofer committed Jan 18, 2019
1 parent c8d39eb commit 9baa911
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions library/privacy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
/**
* Functionality to improve privacy of users.
*
* @package FoundationPress
* @since FoundationPress 3.0.0
*/

/**
* Replaces normal YouTube embeds with nocookie embeds
* in the_content to improve privacy of users.
*
* @param string $content the content.
*/
function foundationpress_replace_youtube_nocookie( $content ) {
return str_replace( 'youtube.com/embed', 'youtube-nocookie.com/embed', $content );
}
add_filter( 'the_content', 'foundationpress_replace_youtube_nocookie', 99999 );


/**
* Remove IPs from comments.
*
* @param string $comment_author_ip the ip of the comment author.
*/
function foundationpress_remove_commentsip( $comment_author_ip ) {
return '';
}
add_filter( 'pre_comment_user_ip', 'foundationpress_remove_commentsip' );

0 comments on commit 9baa911

Please sign in to comment.