Last active
March 1, 2017 22:19
-
-
Save sbruner/b54b838632e382c663aef358a58db37e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
//When the user enters data in the piklist_demo_fields settings page and they press save, add another setting called option_key with the value of option_value. | |
add_filter('piklist_pre_update_option','my_update_option',10,4); | |
function my_update_option($settings, $new, $old) { | |
if ($setting == 'piklist_demo_fields') { | |
$settings['option_key'] = 'option_value'; | |
} | |
return $settings; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm a bit confused about this one... unless $setting is global, I can't see where it comes from. Missing from the function signature?