-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add file for privacy related functions
- Loading branch information
1 parent
c8d39eb
commit 9baa911
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' ); |