Created
April 3, 2018 03:55
-
-
Save kristarella/944d10af31d02aece850826d3420c653 to your computer and use it in GitHub Desktop.
This plugin removes location data from posts published between the start and end dates.You can delete lines 14, 15, 16, 18 and 20 if you want to remove location from all posts.
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
<?php | |
/* | |
Plugin Name: Exif remove location | |
Description: Hide the location from Exifography for certain dates | |
Version: 20180403 | |
Author: kristarella | |
License: GPL2 | |
License URI: https://www.gnu.org/licenses/gpl-2.0.html | |
*/ | |
/* removes location as a field between the start and end dates */ | |
function exif_unset_location($fields) { | |
global $post; | |
$start_date = strtotime( '2017-11-01' ); | |
$end_date = strtotime( '2017/11/29' ); | |
$post_date = strtotime( $post->post_date ); | |
if ($post_date > $start_date || $post_date < $end_date) { | |
unset($fields['location']); | |
} | |
return $fields; | |
} | |
add_filter('exifography_display_exif','exif_unset_location'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment