all repos — wp-extraexif @ db5eef768f9d5d18424c4ff7e8aa6f230b793d56

no config file for now
Peter Molnar hello@petermolnar.eu
Wed, 10 Aug 2016 09:22:28 +0000
commit

db5eef768f9d5d18424c4ff7e8aa6f230b793d56

parent

b6b4fe3c84beb62ce3d979276950d26fe7f53ff3

1 files changed, 14 insertions(+), 14 deletions(-)

jump to
M wp-extraexif.phpwp-extraexif.php

@@ -35,7 +35,8 @@ /**

* */ function defaults() { - return array ( + // hardcoded + $config = array ( // exiftool value => store as meta key 'LensID' => 'lens', 'GPSLatitude' => 'geo_latitude',

@@ -43,8 +44,19 @@ 'GPSLongitude' => 'geo_longitude',

'GPSAltitude' => 'geo_altitude', 'Title' => 'title', ); -} + $ini = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'config.ini'; + if ( file_exists ( $ini ) ) { + $config = array_merge ( $config, parse_ini_file( $ini ) ); + } + + $current = \get_option( __NAMESPACE__ ); + + if ( $current != $config ) + \update_option( __NAMESPACE__, $config ); + + return $config; +} /** * activate hook

@@ -243,15 +255,3 @@ $parent = $caller['namespace'] . '::' . $parent;

return error_log( "{$parent}: {$message}" ); } - -/* -function ini2conf() { - $config = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'config.ini'; - if ( !file_exists ( $config ) ) - return defaults(); - - $params = parse_ini_file( $config ); - \update_option( __NAMESPACE__, $params, true ); - return $params; -} -*/